copyWith method
ToastrConfig
copyWith({
- ToastrType? type,
- String? message,
- String? title,
- Duration? duration,
- Duration? extendedTimeout,
- bool? dismissible,
- bool? showCloseButton,
- Widget? customIcon,
- Color? backgroundColor,
- Color? textColor,
- Duration? showDuration,
- Duration? hideDuration,
- ToastrPosition? position,
- ToastrShowMethod? showMethod,
- ToastrHideMethod? hideMethod,
- Curve? showEasing,
- Curve? hideEasing,
- bool? showProgressBar,
- bool? preventDuplicates,
- String? duplicateKey,
- VoidCallback? onTap,
- VoidCallback? onDismiss,
- Widget? content,
- double? maxWidth,
- EdgeInsets? margin,
- Color? accentColor,
- BoxDecoration? containerDecoration,
- ToastrTheme? theme,
- bool? reverseOrder,
- ToastrAction? action,
- bool? enableHapticFeedback,
- HapticFeedbackType? hapticFeedbackType,
- SwipeDismissDirection? swipeDismissDirection,
- Widget enterAnimationBuilder()?,
- Widget exitAnimationBuilder()?,
- bool? compact,
- BorderRadius? borderRadius,
- bool? avoidKeyboard,
- double? stackOverlap,
- bool? showCircularProgress,
- double? gutter,
- ToastrIconTheme? iconTheme,
Creates a copy of this config with updated values
Implementation
ToastrConfig copyWith({
ToastrType? type,
String? message,
String? title,
Duration? duration,
Duration? extendedTimeout,
bool? dismissible,
bool? showCloseButton,
Widget? customIcon,
Color? backgroundColor,
Color? textColor,
Duration? showDuration,
Duration? hideDuration,
ToastrPosition? position,
ToastrShowMethod? showMethod,
ToastrHideMethod? hideMethod,
Curve? showEasing,
Curve? hideEasing,
bool? showProgressBar,
bool? preventDuplicates,
String? duplicateKey,
VoidCallback? onTap,
VoidCallback? onDismiss,
Widget? content,
double? maxWidth,
EdgeInsets? margin,
Color? accentColor,
BoxDecoration? containerDecoration,
ToastrTheme? theme,
bool? reverseOrder,
ToastrAction? action,
bool? enableHapticFeedback,
HapticFeedbackType? hapticFeedbackType,
SwipeDismissDirection? swipeDismissDirection,
Widget Function(Widget child, Animation<double> animation)?
enterAnimationBuilder,
Widget Function(Widget child, Animation<double> animation)?
exitAnimationBuilder,
bool? compact,
BorderRadius? borderRadius,
bool? avoidKeyboard,
double? stackOverlap,
bool? showCircularProgress,
double? gutter,
ToastrIconTheme? iconTheme,
}) => ToastrConfig(
type: type ?? this.type,
message: message ?? this.message,
title: title ?? this.title,
duration: duration ?? this.duration,
extendedTimeout: extendedTimeout ?? this.extendedTimeout,
dismissible: dismissible ?? this.dismissible,
showCloseButton: showCloseButton ?? this.showCloseButton,
customIcon: customIcon ?? this.customIcon,
backgroundColor: backgroundColor ?? this.backgroundColor,
textColor: textColor ?? this.textColor,
showDuration: showDuration ?? this.showDuration,
hideDuration: hideDuration ?? this.hideDuration,
position: position ?? this.position,
showMethod: showMethod ?? this.showMethod,
hideMethod: hideMethod ?? this.hideMethod,
showEasing: showEasing ?? this.showEasing,
hideEasing: hideEasing ?? this.hideEasing,
showProgressBar: showProgressBar ?? this.showProgressBar,
preventDuplicates: preventDuplicates ?? this.preventDuplicates,
duplicateKey: duplicateKey ?? this.duplicateKey,
onTap: onTap ?? this.onTap,
onDismiss: onDismiss ?? this.onDismiss,
content: content ?? this.content,
maxWidth: maxWidth ?? this.maxWidth,
margin: margin ?? this.margin,
accentColor: accentColor ?? this.accentColor,
containerDecoration: containerDecoration ?? this.containerDecoration,
theme: theme ?? this.theme,
reverseOrder: reverseOrder ?? this.reverseOrder,
action: action ?? this.action,
enableHapticFeedback: enableHapticFeedback ?? this.enableHapticFeedback,
hapticFeedbackType: hapticFeedbackType ?? this.hapticFeedbackType,
swipeDismissDirection:
swipeDismissDirection ?? this.swipeDismissDirection,
enterAnimationBuilder:
enterAnimationBuilder ?? this.enterAnimationBuilder,
exitAnimationBuilder:
exitAnimationBuilder ?? this.exitAnimationBuilder,
compact: compact ?? this.compact,
borderRadius: borderRadius ?? this.borderRadius,
avoidKeyboard: avoidKeyboard ?? this.avoidKeyboard,
stackOverlap: stackOverlap ?? this.stackOverlap,
showCircularProgress: showCircularProgress ?? this.showCircularProgress,
gutter: gutter ?? this.gutter,
iconTheme: iconTheme ?? this.iconTheme,
);