copyWith method Null safety

SnackBarThemeData copyWith(
  1. {Color? backgroundColor,
  2. Color? actionTextColor,
  3. Color? disabledActionTextColor,
  4. TextStyle? contentTextStyle,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. SnackBarBehavior? behavior}
)

Creates a copy of this object with the given fields replaced with the new values.

Implementation

SnackBarThemeData copyWith({
  Color? backgroundColor,
  Color? actionTextColor,
  Color? disabledActionTextColor,
  TextStyle? contentTextStyle,
  double? elevation,
  ShapeBorder? shape,
  SnackBarBehavior? behavior,
}) {
  return SnackBarThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    actionTextColor: actionTextColor ?? this.actionTextColor,
    disabledActionTextColor: disabledActionTextColor ?? this.disabledActionTextColor,
    contentTextStyle: contentTextStyle ?? this.contentTextStyle,
    elevation: elevation ?? this.elevation,
    shape: shape ?? this.shape,
    behavior: behavior ?? this.behavior,
  );
}