Toaster
Hosts toast notifications. Place one high in the app (wrapping your content); it floats toasts in a screen corner above everything — including modals — via an Overlay entry, stacking them and auto-dismissing each after a delay unless it is persistent.
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
// Wrap your app once:Toaster(child: app)
// …then from anywhere below it:Toaster.show(context, 'Saved', severity: ToastSeverity.success);Details
Section titled “Details”To show a toast from anywhere below it, call Toaster.show with a
BuildContext and the message. It returns a ToastHandle that can
dismiss that toast early.
Constructors
Section titled “Constructors”Toaster()
Section titled “Toaster()”| Parameter | Type | Default | Description |
|---|---|---|---|
child: | Widget | required | Application subtree over which toast overlays are presented. |
alignment: | Alignment | Alignment.bottomRight | Which corner toasts stack in. |
duration: | Duration | const Duration(seconds: 5) | How long each toast stays before auto-dismissing. |
maxToasts: | int? | — | Maximum retained toasts. Null preserves unrestricted stacking. More |
maxToasts: Adding a distinct toast while full evicts the oldest, even if persistent. There is no pending queue. Replacing an ID retains its position and does not consume another slot. Reducing the limit also evicts oldest toasts.
Source
Section titled “Source”Toaster is defined in packages/fleury/lib/src/catalog/toaster.dart.
Category: Navigation & overlays · All widgets