copyWith method

  1. @override
ToastThemeData copyWith({
  1. TextStyle? textStyle,
  2. TextAlign? textAlign,
  3. Color? backgroundColor,
  4. Color? foregroundColor,
  5. Color? maskColor,
  6. EdgeInsetsGeometry? padding,
  7. BorderRadius? borderRadius,
  8. VisualDensity? visualDensity,
  9. ToastAnimation? animation,
  10. double? verticalGap,
  11. double? indicatorSize,
  12. double? indicatorWidth,
  13. Widget? indicator,
  14. Widget? successIcon,
  15. Widget? errorIcon,
  16. Widget? informationIcon,
  17. ToastPosition? position,
  18. Duration? animationDuration,
  19. Duration? displayDuration,
  20. bool? dismissOnTap,
  21. bool? isInteractive,
  22. 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,
  );
}