Toast
showPaymentToast confirms that something happened: “Reference copied”, “Share canceled”. It floats at the bottom of the screen and goes away on its own. On a screen with a pinned kit footer, such as a detail page or the payment path, it floats 16 dp above the footer, so the footer actions stay visible and tappable.



showPaymentToast(context, message: s.viewReceipt);Variants
Section titled “Variants”Variants: neutral, info, success, warning, danger; pending.
tone selects the icon. Ink tokens provide textPrimary fill and surface text in both themes.
| Tone | Icon |
|---|---|
neutral (default), info |
Icons.info_outline |
success |
Icons.check_circle_outline |
warning |
Icons.warning_amber_outlined |
danger |
Icons.error_outline |
With undo
Section titled “With undo”Pass both actionLabel and onAction to add an action. If either is missing, no action is shown.
showPaymentToast( context, message: 'Promo hidden', actionLabel: 'Undo', onAction: () => host.restorePromo(promo.id),);Pending and reading time
Section titled “Pending and reading time”Tones are neutral, success and warning. Pending uses a small spinner and never times out. A blocking failure belongs in a banner.
final toast = showPaymentToast(context, message: 'Refreshing balance…', pending: true);toast.update('Balance updated', tone: StatusTone.success);Short messages last 4 seconds, or 6 with an action. Longer messages get 1 second plus 300 ms per word, capped at 10 seconds. An action remains available during accessible navigation. Ink toasts use textPrimary fill and surface text, with no shadow. Aim for about 30 characters. Updates keep the same toast on screen; dismiss is safe to repeat.
Above a pinned footer
Section titled “Above a pinned footer”A toast floats group above the kit’s pinned footer on the current route, so the footer’s actions stay reachable. This covers view and page footers, ActionFrame, the action bar and the KYC capture footer. The scaffold already lifts the toast above its bottom navigation bar, floating action button, safe area and keyboard.


Known limits. These are unsupported cases, not fixed behaviour:
- The clearance is measured once, when the toast shows. If a pinned footer appears, leaves or changes height while a toast is up, the toast stays where it is. The theme is also captured once. Workaround: show the toast after the footer change settles. If a footer appears while feedback is still useful, show the toast again; the new toast replaces the old one.
Scaffold.persistentFooterButtonsis not measured. The kit doesn’t use that slot. The scaffold still lifts the toast above those buttons. But on a screen with both a kit pinned footer in the body andpersistentFooterButtons, the kit measures from the screen’s bottom edge, so the toast sits higher than needed by the buttons’ height. It never covers either footer. Workaround: put the actions in the kit footer, such as a view’sprimaryActionor aPaymentActionBarinbottomNavigationBar, instead ofpersistentFooterButtons.
Replacing a toast
Section titled “Replacing a toast”Only the newest toast counts. Showing a toast replaces the kit toast on screen and drops any kit toast still waiting, so feedback never waits behind another toast’s reading time. The toast on screen leaves over 150 ms, then the new one enters. With reduced motion the swap is instant. A replaced toast’s controller stops responding: update and dismiss do nothing, and closed completes when it leaves. A waiting kit toast dropped by your app’s clearSnackBars() completes when a later kit toast reaches the front; a dropped waiting legacy showPaymentSnackBar future never completes. A controller keeps working until its toast closes, even after a route with its own Scaffold is popped.
A toast takes its look from where you show it. Themes scoped between your context and the ScaffoldMessenger, such as a feature’s own PaymentTheme, are captured once when the toast shows; app themes above the messenger remain live only where no captured theme shadows them. A captured Material Theme freezes its full ThemeData, including copied app values. To restyle toasts, scope PaymentTheme; there is no toast style.
If your app also calls ScaffoldMessenger.showSnackBar, a kit toast replaces your snack bar when it is on screen. When reduced motion turns on or off, and before the first kit toast on a messenger, the kit clears the whole snack bar queue, your bars included. Flutter rebuilds its snack bar animation when the timing changes, and a bar left waiting would freeze the queue. A dropped bar’s closed never completes. If your own bars pass snackBarAnimationStyle, the kit can’t see that change.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Report sent or downloads prepared | success | Use short outcome copy; pending controllers can update or dismiss host work. |
Use inline error for correcting a field or report.
States
Section titled “States”Show success only after the host operation succeeds. Pending can be replaced with its result through the returned controller.
Layout. The icon or spinner and the action centre on the message’s first line, so a short toast reads on one line and a long one keeps the icon beside its first line. At large text, an action that would squeeze the message onto several lines moves under it, on the end edge; a close button from your snack bar theme stays on the first line.
Do and don’t
Section titled “Do and don’t”Do: Use short outcome copy; pending controllers can update or dismiss host work.
Don’t: Replace persistent payment status with a transient toast.
Content guidelines
Section titled “Content guidelines”- Say what happened in the past tense, in a few words: “Reference copied”, “Card removed”.
- One message per toast. Do not put instructions or errors that need attention in a toast; it disappears. Use a notice banner instead.
- Never report a payment result in a toast. Payment status belongs on the status screen.
- Action labels are one verb: “Undo”, “View”.
Accessibility
Section titled “Accessibility”- Screen readers announce snack bars automatically.
- The tone adds an icon, so the message is not carried by color alone. The icon is excluded from semantics; the message is what is read.
showPaymentToast
PaymentToastController showPaymentToast(…) · lib/src/interaction/interaction.dart
Short feedback after an action. Failures requiring a fix use PaymentBanner. Neutral, success, warning, or pending. Reading time is 4–10 seconds, at least 6 with an action; pending and accessible actions never time out. The newest toast wins: showing one replaces the kit toast on screen and drops any kit toast still waiting (D77). When reduced motion changes, the whole snack bar queue is cleared first, host snack bars included (D78). The toast takes its look from the themes around context: themes scoped below the ScaffoldMessenger are captured once when it shows, and app themes above the messenger stay live only where no captured theme shadows them; a captured Material Theme freezes its full ThemeData (D103).
| Parameter | Type | Default | Description |
|---|---|---|---|
contextrequiredpositional | BuildContext | — | — |
message:required | String | — | — |
tone: | StatusTone | StatusTone.neutral | — |
pending: | bool | false | — |
actionLabel: | String? | — | — |
onAction: | VoidCallback? | — | — |
PaymentToastController
class PaymentToastController · lib/src/interaction/interaction.dart
Controls one toast from showPaymentToast.
showPaymentSnackBar
ScaffoldFeatureController<SnackBar, SnackBarClosedReason> showPaymentSnackBar(…) · lib/src/interaction/interaction.dart
Deprecated. Use showPaymentToast.
Deprecated wrapper of showPaymentToast returning the Material controller.
| Parameter | Type | Default | Description |
|---|---|---|---|
contextrequiredpositional | BuildContext | — | — |
message:required | String | — | — |
tone: | StatusTone | StatusTone.neutral | — |
actionLabel: | String? | — | — |
onAction: | VoidCallback? | — | — |
Migration
Section titled “Migration”showPaymentSnackBar is a deprecated wrapper returning the Material controller. Use showPaymentToast for pending, update and dismiss.
A replaced toast’s legacy controller closes with SnackBarClosedReason.hide. One dropped from behind your own snack bar when reduced motion changes never completes.
See also
Section titled “See also”- Notice banner for messages that must stay.
- Dialog to ask before an action instead of offering undo after it.