copyWith method

SnackbarConfig copyWith({
  1. Duration? duration,
  2. SnackbarPosition? position,
  3. Color? backgroundColor,
  4. Color? textColor,
  5. IconData? icon,
  6. Color? iconColor,
  7. String? actionLabel,
  8. VoidCallback? onActionPressed,
  9. Color? actionTextColor,
  10. BorderRadius? borderRadius,
  11. EdgeInsets? padding,
  12. EdgeInsets? margin,
  13. Duration? animationDuration,
  14. double? maxWidth,
  15. double? minWidth,
  16. double? elevation,
  17. bool? showCloseButton,
  18. SnackbarAnimationType? animationType,
})

Creates a copy of this configuration with the given fields replaced

Implementation

SnackbarConfig copyWith({
  Duration? duration,
  SnackbarPosition? position,
  Color? backgroundColor,
  Color? textColor,
  IconData? icon,
  Color? iconColor,
  String? actionLabel,
  VoidCallback? onActionPressed,
  Color? actionTextColor,
  BorderRadius? borderRadius,
  EdgeInsets? padding,
  EdgeInsets? margin,
  Duration? animationDuration,
  double? maxWidth,
  double? minWidth,
  double? elevation,
  bool? showCloseButton,
  SnackbarAnimationType? animationType,
}) {
  return SnackbarConfig(
    duration: duration ?? this.duration,
    position: position ?? this.position,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    textColor: textColor ?? this.textColor,
    icon: icon ?? this.icon,
    iconColor: iconColor ?? this.iconColor,
    actionLabel: actionLabel ?? this.actionLabel,
    onActionPressed: onActionPressed ?? this.onActionPressed,
    actionTextColor: actionTextColor ?? this.actionTextColor,
    borderRadius: borderRadius ?? this.borderRadius,
    padding: padding ?? this.padding,
    margin: margin ?? this.margin,
    animationDuration: animationDuration ?? this.animationDuration,
    maxWidth: maxWidth ?? this.maxWidth,
    minWidth: minWidth ?? this.minWidth,
    elevation: elevation ?? this.elevation,
    showCloseButton: showCloseButton ?? this.showCloseButton,
    animationType: animationType ?? this.animationType,
  );
}