DesignToast class
What a toast says and does. The look reads the fields it paints; data carries anything else it needs (a tone, an icon).
- Annotations
Constructors
- DesignToast({required String message, String? title, String? actionLabel, VoidCallback? onAction, Duration? duration = const Duration(seconds: 4), Object? id, Object? data})
-
A toast reading
message.const
Properties
- actionLabel → String?
-
The action's label ("Undo"), when it has one.
final
- data → Object?
-
Anything else the look paints from.
final
- duration → Duration?
-
How long it stays once shown, while not paused. Null: until dismissed.
A toast with an action stays until dismissed while a screen reader
runs (MediaQueryData.accessibleNavigation), as Material's does.
final
- hasAction → bool
-
Whether it carries an action.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → Object?
-
Showing a toast with the id of one already shown or waiting replaces
it in place, its time restarted.
final
- message → String
-
The text, and what a screen reader announces.
final
- onAction → VoidCallback?
-
What the action does. The toast closes after it runs.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String?
-
A heading above message, when it has one.
final
Methods
-
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