NIB / PLAYGROUND
Toast playground — NibComponents
Try toast in Flutter. Announce a local outcome, handle duplicate ids, and provide an undo action.
Open interactive viewAnnounce a local outcome, handle duplicate ids, and provide an undo action.
Read the full component guide and API
Public widgets and APIs
- NibToastDuplicateBehavior
- NibToastPosition
- NibToastPositionX
- NibToastVariant
- NibToastVariantX
- NibToaster
- dismissAllNibToasts
- dismissNibToast
- showNibToast
Example Dart code
final id = showNibToast(
context: context,
id: 'draft-saved',
title: 'Draft saved',
variant: NibToastVariant.success,
actionLabel: 'Undo',
onAction: () { /* Restore the previous local state. */ },
);
// If the operation is cancelled elsewhere:
dismissNibToast(id);Playground controls
| Control | Type | Options or range | Help |
|---|---|---|---|
| Surface title | text | ||
| Outcome style | choice | normal, success, error, warning, info | |
| Stack position | choice | topLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight | |
| Auto-dismiss milliseconds (0: persistent) | number | 0.0–8000.0 | |
| Replace duplicates (off: ignore) | toggle | ||
| Animate opening and closing | toggle |