copyWith method

ToastMeta copyWith({
  1. Widget? icon,
  2. String? title,
  3. String? style,
  4. String? description,
  5. Color? color,
  6. Function? action,
  7. Function? dismiss,
  8. Duration? duration,
})

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,
    Function? action,
    Function? dismiss,
    Duration? duration}) {
  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,
    duration: duration ?? this.duration,
  );
}