ToastType class
customization options for the toast. errorToast, warningToast, and successToast are sensible defaults for toasts that fullfill most toast requirements. If you'd like to create your own toast, you may construct an instance of ToastType.
actionColor is the color of the text that is prompting the user action; this is generally the same color as iconBgColor, but much darker so it is readable.
icon is the icon that is displayed with the toast.
iconBgColor is the color that the icon will be painted on. This is useful in some designs, including the default toast.
example:
final infoToast = ToastType(
actionColor: Colors.red.blue900,
iconBgColor: Colors.red.blue50,
icon: const Icon(
Icons.info,
color: Colors.blue,
size: ToastType.defaultToastIconSize,
));
Constructors
- ToastType.new({required Color actionColor, required Color iconBgColor, required Icon icon})
-
const
Properties
- actionColor → Color
-
the color of the action text on the toast.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Icon
-
final
- iconBgColor → Color
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Constants
- defaultToastIconSize → const double