SubZeroToast class

Toast utility class for showing overlay-based toast messages

Usage:

// Simple toast
SubZeroToast.show(context, message: 'Self recommendation completed');

// Success toast with action
SubZeroToast.success(context, message: 'Item saved!');

// Toast with custom action
SubZeroToast.show(
  context,
  message: 'Item deleted',
  actionLabel: 'UNDO',
  onAction: () => undoDelete(),
);

Constructors

SubZeroToast()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

defaultToast(BuildContext context, {required String message, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction}) → void
Shows a default (dark) toast
dismiss() → void
Manually dismiss the current toast
error(BuildContext context, {required String message, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction}) → void
Shows an error toast
info(BuildContext context, {required String message, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction}) → void
Shows an info toast
show(BuildContext context, {required String message, SubZeroToastType type = SubZeroToastType.defaultType, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction, IconData? leadingIcon, bool showCloseButton = true, double? maxWidth}) → void
Shows a toast with full configuration
success(BuildContext context, {required String message, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction}) → void
Shows a success toast
warning(BuildContext context, {required String message, SubZeroToastPosition position = SubZeroToastPosition.bottom, SubZeroToastActionMode actionMode = SubZeroToastActionMode.icon, Duration duration = const Duration(seconds: 4), String? actionLabel, VoidCallback? onAction}) → void
Shows a warning toast