Different from other Neo widgets: Toast is used as a method call (
NeoToast.show()) rather than a widget you place in your build tree. Call it inside callbacks—after button presses, successful API calls, or when operations complete—to provide instant user feedback.Examples
- Toast Types
- With Description
- With Action
- Update Toast
Methods
NeoToast.show()
Displays a toast notification at the bottom right of the screen. Returns a string ID that can be used to update the toast later.Required Parameters
WidgetRef
required
The widget reference from a
ConsumerWidget or HookConsumerWidget, used to access the toast provider.String
required
The main text message to display in the toast.
NeoToastType
required
The preset type that determines styling, icon, and behavior. Use presets for consistent UX.
Optional Parameters
String
Additional text displayed below the main label for extra context.
NeoToastAction
A small secondary button under the text. Auto-dismiss still follows
type.Object?
Custom icon to override the preset icon from
type. Pass a Phosphor icon from phosphoricons_flutter.Color
Custom color to override the preset color from
type.bool
Custom auto-dismiss behavior to override the preset from
type.bool
Whether the icon should rotate continuously (e.g. for custom loading states).
bool
Whether to show a dismiss button. If null, determined by
autoDismiss setting.NeoToast.update()
Updates an existing toast. You could use it for progress, or when the message changes.Required Parameters
WidgetRef
required
The widget reference to access the toast provider.
String
required
The ID returned from
NeoToast.show() to identify which toast to update.Optional Parameters
NeoToastType
New preset type to apply. Updates styling, icon, and behavior.
String
New main text message.
String
New description text.
NeoToastAction
A new action button.
Object?
New custom icon. Pass a Phosphor icon from
phosphoricons_flutter.Color
New custom color.
bool
New auto-dismiss behavior.
bool
New icon rotation state.
bool
New dismiss button visibility.
Action
NeoToastAction is the button passed to action.
Required
String
required
The text on the button.
VoidCallback
required
Called when the button is pressed. The toast dismisses after that call. A second press does not call it again.
Enums
NeoToastType
Predefined toast configurations that automatically handle styling and behavior.info: General informationloading: Ongoing operations with spinnersuccess: Successful actions with checkmark iconwarning: Cautionary messages with warning icondanger: Error states with error icon
Best Practices
- Use a
NeoToastTypepreset unless you need a custom toast. - Call
NeoToast.update()when one operation moves from loading to success or danger. - You could put a file path, an error code, or a next step in
description. - You could use
actionfor a follow-up, such as undo. SetautoDismiss: falsewhen that follow-up should stay on screen. - Do not also call
NeoHapticsfor the same show or update.
Behavior
- Toasts stack vertically. Each toast’s height is measured, and the stack moves when one changes.
- An update scales the toast up briefly.
- When
autoDismissis on, or a dismiss control is visible, a horizontal drag past about 25% of the width scales the toast down and dismisses it. A shorter drag springs it back. info,success, andwarningdismiss on their own.dangerstays until the user dismisses it.loadingstays until the type changes or you dismiss it.showand a typedupdateplay haptics fromNeoConfig.enableToastHaptics:lightfor a loading show,heavyfor other non-danger types, anderrorfor danger.

