copyWith method

ToastMeta copyWith({
  1. Widget? icon,
  2. String? title,
  3. String? style,
  4. String? description,
  5. Color? color,
  6. VoidCallback? action,
  7. VoidCallback? dismiss,
  8. VoidCallback? onDismiss,
  9. VoidCallback? onShow,
  10. Duration? duration,
  11. ToastNotificationPosition? position,
  12. Map<String, dynamic>? metaData,
  13. ToastAnimation? animation,
  14. ToastAnimation? reverseAnimation,
  15. bool? dismissOtherToast,
  16. TextDirection? textDirection,
  17. Alignment? alignment,
  18. Axis? axis,
  19. Offset? startOffset,
  20. Offset? endOffset,
  21. Offset? reverseStartOffset,
  22. Offset? reverseEndOffset,
  23. bool? isHideKeyboard,
  24. bool? isIgnoring,
  25. CustomAnimationBuilder? animationBuilder,
  26. CustomAnimationBuilder? reverseAnimBuilder,
  27. ToastOnInitStateCallback? onInitState,
})

ToastMeta.copyWith() is used to copy the current toast alert and override the values.

Implementation

ToastMeta copyWith({
  Widget? icon,
  String? title,
  String? style,
  String? description,
  Color? color,
  VoidCallback? action,
  VoidCallback? dismiss,
  VoidCallback? onDismiss,
  VoidCallback? onShow,
  Duration? duration,
  ToastNotificationPosition? position,
  Map<String, dynamic>? metaData,
  ToastAnimation? animation,
  ToastAnimation? reverseAnimation,
  bool? dismissOtherToast,
  TextDirection? textDirection,
  Alignment? alignment,
  Axis? axis,
  Offset? startOffset,
  Offset? endOffset,
  Offset? reverseStartOffset,
  Offset? reverseEndOffset,
  bool? isHideKeyboard,
  bool? isIgnoring,
  CustomAnimationBuilder? animationBuilder,
  CustomAnimationBuilder? reverseAnimBuilder,
  ToastOnInitStateCallback? onInitState,
}) {
  return ToastMeta(
    icon: icon ?? this.icon,
    title: title ?? this.title,
    style: style ?? this.style,
    description: description ?? this.description,
    color: color ?? this.color,
    action: action ?? this.action,
    dismiss: dismiss ?? this.dismiss,
    onDismiss: onDismiss ?? this.onDismiss,
    onShow: onShow ?? this.onShow,
    duration: duration ?? this.duration,
    position: position ?? this.position,
    metaData: metaData ?? this.metaData,
    animation: animation ?? this.animation,
    reverseAnimation: reverseAnimation ?? this.reverseAnimation,
    dismissOtherToast: dismissOtherToast ?? this.dismissOtherToast,
    textDirection: textDirection ?? this.textDirection,
    alignment: alignment ?? this.alignment,
    axis: axis ?? this.axis,
    startOffset: startOffset ?? this.startOffset,
    endOffset: endOffset ?? this.endOffset,
    reverseStartOffset: reverseStartOffset ?? this.reverseStartOffset,
    reverseEndOffset: reverseEndOffset ?? this.reverseEndOffset,
    isHideKeyboard: isHideKeyboard ?? this.isHideKeyboard,
    isIgnoring: isIgnoring ?? this.isIgnoring,
    animationBuilder: animationBuilder ?? this.animationBuilder,
    reverseAnimBuilder: reverseAnimBuilder ?? this.reverseAnimBuilder,
    onInitState: onInitState ?? this.onInitState,
  );
}