copyWith method

SnackBarThemeData copyWith({
  1. Color? backgroundColor,
  2. Color? actionTextColor,
  3. Color? disabledActionTextColor,
  4. TextStyle? contentTextStyle,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. SnackBarBehavior? behavior,
  8. double? width,
  9. EdgeInsets? insetPadding,
  10. bool? showCloseIcon,
  11. Color? closeIconColor,
  12. double? actionOverflowThreshold,
  13. Color? actionBackgroundColor,
  14. Color? disabledActionBackgroundColor,
  15. DismissDirection? dismissDirection,
})

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,
  double? width,
  EdgeInsets? insetPadding,
  bool? showCloseIcon,
  Color? closeIconColor,
  double? actionOverflowThreshold,
  Color? actionBackgroundColor,
  Color? disabledActionBackgroundColor,
  DismissDirection? dismissDirection,
}) {
  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,
    width: width ?? this.width,
    insetPadding: insetPadding ?? this.insetPadding,
    showCloseIcon: showCloseIcon ?? this.showCloseIcon,
    closeIconColor: closeIconColor ?? this.closeIconColor,
    actionOverflowThreshold: actionOverflowThreshold ?? this.actionOverflowThreshold,
    actionBackgroundColor: actionBackgroundColor ?? this.actionBackgroundColor,
    disabledActionBackgroundColor: disabledActionBackgroundColor ?? this.disabledActionBackgroundColor,
    dismissDirection: dismissDirection ?? this.dismissDirection,
  );
}