copyWith method
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,
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,
);
}