showPaymentToast function

PaymentToastController showPaymentToast(
  1. BuildContext context, {
  2. required String message,
  3. StatusTone tone = StatusTone.neutral,
  4. bool pending = false,
  5. String? actionLabel,
  6. VoidCallback? onAction,
})

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).

Implementation

PaymentToastController showPaymentToast(
  BuildContext context, {
  required String message,
  StatusTone tone = StatusTone.neutral,
  bool pending = false,
  String? actionLabel,
  VoidCallback? onAction,
}) => _showToast(
  context,
  message: message,
  tone: tone,
  pending: pending,
  actionLabel: actionLabel,
  onAction: onAction,
);