copyWith method
ToastThemeData
copyWith({
- TextStyle? textStyle,
- TextAlign? textAlign,
- Color? backgroundColor,
- Color? foregroundColor,
- Color? maskColor,
- EdgeInsetsGeometry? padding,
- BorderRadius? borderRadius,
- VisualDensity? visualDensity,
- ToastAnimation? animation,
- double? verticalGap,
- double? indicatorSize,
- double? indicatorWidth,
- Widget? indicator,
- Widget? successIcon,
- Widget? errorIcon,
- Widget? informationIcon,
- ToastPosition? position,
- Duration? animationDuration,
- Duration? displayDuration,
- bool? dismissOnTap,
- bool? isInteractive,
- ToastAnimationBuilder? animationBuilder,
override
创建此对象的副本,但将给定字段替换为新值。
Implementation
@override
ToastThemeData copyWith({
TextStyle? textStyle,
TextAlign? textAlign,
Color? backgroundColor,
Color? foregroundColor,
Color? maskColor,
EdgeInsetsGeometry? padding,
BorderRadius? borderRadius,
VisualDensity? visualDensity,
ToastAnimation? animation,
double? verticalGap,
double? indicatorSize,
double? indicatorWidth,
Widget? indicator,
Widget? successIcon,
Widget? errorIcon,
Widget? informationIcon,
ToastPosition? position,
Duration? animationDuration,
Duration? displayDuration,
bool? dismissOnTap,
bool? isInteractive,
ToastAnimationBuilder? animationBuilder,
}) {
return ToastThemeData(
textStyle: textStyle ?? this.textStyle,
textAlign: textAlign ?? this.textAlign,
backgroundColor: backgroundColor ?? this.backgroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
maskColor: maskColor ?? this.maskColor,
padding: padding ?? this.padding,
borderRadius: borderRadius ?? this.borderRadius,
visualDensity: visualDensity ?? this.visualDensity,
verticalGap: verticalGap ?? this.verticalGap,
indicatorSize: indicatorSize ?? this.indicatorSize,
indicatorWidth: indicatorWidth ?? this.indicatorWidth,
indicator: indicator ?? this.indicator,
successIcon: successIcon ?? this.successIcon,
errorIcon: errorIcon ?? this.errorIcon,
informationIcon: informationIcon ?? this.informationIcon,
position: position ?? this.position,
animationDuration: animationDuration ?? this.animationDuration,
displayDuration: displayDuration ?? this.displayDuration,
dismissOnTap: dismissOnTap ?? this.dismissOnTap,
isInteractive: isInteractive ?? this.isInteractive,
animationBuilder: animationBuilder ?? this.animationBuilder,
);
}