Skip to content

Toast

A toast notification component that displays temporary messages at the bottom of the screen. Toasts are used to show brief, non-intrusive feedback about an operation.

The Toast widget provides a flexible system for showing notifications with various configurations including message, caption, icons, and action buttons. The Toast.show() static method provides a convenient way to display these notifications.

  • Content Types: Message, caption, icons
  • Actions: Optional action button with text or icon
  • Styles: Subtle, contrast, and accent variants
  • Auto-dismiss: Automatic dismissal with customizable duration

Basic toast with default subtle styling.


Toast with contrasting background for better visibility.


Toast with accent color background for important messages.


Toast with an additional caption text.


Toast with a text action button.


Toast with an icon button action.


Toast with a leading icon.


PropertyTypeDescription
messageStringThe main text displayed in the toast.
captionString?Optional secondary text shown below the main message.
typeToastTypeVisual style of the toast.
leadingIconWidget?Optional icon widget displayed at the start of the toast.
actionTextString?Text for the optional action button.
onActionPressedVoidCallback?Callback function when the action button is pressed.
actionIconWidget?Optional icon widget for the action instead of text.
durationDurationTime before the toast auto-dismisses. Default: 4 seconds.
marginEdgeInsets?Custom margin around the toast container.
paddingEdgeInsets?Custom padding inside the toast container.
borderRadiusBorderRadius?Custom border radius for the toast container.
elevationdouble?Custom elevation (shadow) for the toast.
messageStyleTextStyle?Custom text style for the main message.
captionStyleTextStyle?Custom text style for the caption.
actionTextStyleTextStyle?Custom text style for the action button text.