showToast method

  1. @override
void showToast(
  1. ShowToastAction action, {
  2. required String message,
  3. String title = '',
  4. String actionLabel = '',
  5. Map<String, Object?> bound = const {},
  6. VoidCallback? onAction,
})
override

Shows a toast. onAction runs when its button (actionLabel) is pressed. Text and bound (the action's variables and the look's offset, evaluated) are read where the action ran.

Implementation

@override
void showToast(ShowToastAction action,
    {required String message,
    String title = '',
    String actionLabel = '',
    Map<String, Object?> bound = const {},
    VoidCallback? onAction}) {
  final c = _context;
  if (c == null) return;
  CodelesslyToast.show(
    c,
    ToastRequest(action,
        message: message,
        title: title,
        actionLabel: actionLabel,
        bound: bound,
        onAction: onAction,
        breakpoints: breakpoints?.call()),
  );
}