Toast class

Shows an animated toast notification as an overlay — no Scaffold needed.

Toast.show(context, 'Saved successfully', type: ToastType.success);
Toast.show(context, 'Connection lost', type: ToastType.error, duration: Duration(seconds: 5));

Properties

hashCode → int
The hash code for this object.
no setterinherited
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

Static Methods

show(BuildContext context, String message, {ToastType type = ToastType.neutral, ToastPosition position = ToastPosition.bottom, Duration duration = const Duration(seconds: 3), String? actionLabel, VoidCallback? onAction, IconData? icon}) → void
Shows a toast notification.