Read page as text

NIB / PLAYGROUND

Toast playground — NibComponents

Try toast in Flutter. Announce a local outcome, handle duplicate ids, and provide an undo action.

Open interactive view

Announce 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

ControlTypeOptions or rangeHelp
Surface titletext
Outcome stylechoicenormal, success, error, warning, info
Stack positionchoicetopLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight
Auto-dismiss milliseconds (0: persistent)number0.0–8000.0
Replace duplicates (off: ignore)toggle
Animate opening and closingtoggle