ToastMeta class
Toast Meta makes it easy to use pre-defined styles in the toast alert.
Constructors
-
ToastMeta({Widget? icon, String title = '', String style = '', String description = '', Color? color, VoidCallback? action, VoidCallback? dismiss, VoidCallback? onDismiss, VoidCallback? onShow, Duration duration = const Duration(seconds: 5), ToastNotificationPosition position = ToastNotificationPosition.top, 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})
Properties
- action → VoidCallback?
-
Callback invoked when the toast notification is tapped.
final
- alignment → Alignment?
-
Alignment of the toast notification.
final
- animation → ToastAnimation?
-
Animation style for the toast notification.
If null, defaults to position-based animation.
final
- animationBuilder → CustomAnimationBuilder?
-
Custom animation builder for the toast.
final
- axis → Axis?
-
Axis for the toast animation.
final
- color → Color?
-
Background color for the icon section.
final
- description → String
-
Description text displayed below the title.
final
- dismiss → VoidCallback?
-
Callback invoked when the dismiss button is pressed.
final
- dismissOtherToast → bool?
-
Whether to dismiss other toasts when this one is shown.
final
- duration → Duration
-
Duration the toast notification is displayed.
final
- endOffset → Offset?
-
End offset for custom animation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
Icon widget displayed in the toast notification.
final
- isHideKeyboard → bool?
-
Whether to hide the keyboard when the toast is shown.
final
- isIgnoring → bool?
-
Whether the toast ignores pointer events.
final
-
metaData
→ Map<
String, dynamic> ? -
Additional metadata that can be passed to custom toast widgets.
final
- onDismiss → VoidCallback?
-
Callback invoked when the toast is auto-dismissed or removed.
final
- onInitState → ToastOnInitStateCallback?
-
Callback invoked when the toast animation controller is initialized.
final
- onShow → VoidCallback?
-
Callback invoked when the toast becomes visible.
final
- position → ToastNotificationPosition
-
Position where the toast notification appears on screen.
final
- reverseAnimation → ToastAnimation?
-
Reverse (exit) animation style for the toast notification.
final
- reverseAnimBuilder → CustomAnimationBuilder?
-
Custom reverse animation builder for the toast.
final
- reverseEndOffset → Offset?
-
End offset for reverse animation.
final
- reverseStartOffset → Offset?
-
Start offset for reverse animation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startOffset → Offset?
-
Start offset for custom animation.
final
- style → String
-
Style identifier for the toast notification.
final
- textDirection → TextDirection?
-
Text direction for the toast notification.
final
- title → String
-
Title text displayed in the toast notification.
final
Methods
-
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}) → ToastMeta - ToastMeta.copyWith() is used to copy the current toast alert and override the values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited