PrismToast class
Adaptive, beautiful toast notifications.
- Compact windows (< 600px): toasts slide up from the bottom edge, nearly full width — the mobile pattern.
- Wide windows: toasts stack in the top-right corner at a fixed card width — the desktop/web notification pattern.
PrismToast.show(
context,
const PrismToastMessage(
message: 'Settings saved.',
type: PrismToastType.success,
),
);
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
-
dismissAll(
) → void - Removes every visible toast immediately.
-
error(
BuildContext context, String message) → void - Shorthand for an error toast.
-
info(
BuildContext context, String message) → void - Shorthand for an info toast.
-
show(
BuildContext context, PrismToastMessage message) → void - Shows an adaptive toast. Safe to call from anywhere with a BuildContext below a Navigator.
-
success(
BuildContext context, String message) → void - Shorthand for a success toast.
-
warning(
BuildContext context, String message) → void - Shorthand for a warning toast.