SnackbarManager class abstract

Abstract interface for snackbar management across platforms

This interface provides dependency inversion for the snackbar manager, enabling testing, mocking, and alternative implementations.

Implementers

Constructors

SnackbarManager()

Properties

activeCount int
Gets the number of active snackbars
no setter
hasActive bool
Whether there are any active snackbars
no setter
hashCode int
The hash code for this object.
no setterinherited
isProcessing bool
Whether the manager is currently processing snackbars
no setter
pendingCount int
Gets the number of pending snackbars
no setter
persistentCount int
Gets the number of persistent snackbars
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateStream Stream<SnackbarState>
Stream of snackbar state changes
no setter

Methods

clearAll() → void
Clears all snackbars and resets state
disableDebugMode() → void
Disables debug mode
dismissAll() int
Dismisses all active snackbars
dismissGroup(String groupId) int
Dismisses all snackbars in a group
dismissSnackbar(String snackbarId) bool
Dismisses a specific snackbar by ID
dispose() → void
Disposes the manager and cleans up resources
enableDebugMode() → void
Enables debug mode
getActiveStates() List<SnackbarState>
Gets the states of all active snackbars
getGroupStates(String groupId) List<SnackbarState>
Gets the states of all snackbars in a group
getSnackbarState(String snackbarId) SnackbarState?
Gets the current state of a specific snackbar
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showAction({required BuildContext context, required String message, required String actionLabel, required VoidCallback onActionPressed, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows an action snackbar with button
showBanner({required BuildContext context, required String message, IconData? icon, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows a banner-style snackbar
showCustom({required BuildContext context, required Widget content, SnackbarPosition position = SnackbarPosition.top, Duration? duration, bool dismissible = true, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows a custom snackbar with provided widget
showError({required BuildContext context, required String message, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows an error snackbar with message
showInfo({required BuildContext context, required String message, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows a simple info snackbar with message
showLoading({required BuildContext context, String message = 'Loading...', double? progressValue, bool showProgress = true, bool cancellable = false}) LoadingSnackbarController
Shows a loading snackbar with optional progress
showPersistent({required BuildContext context, required String message, String? persistentId, IconData? icon, bool showCloseButton = true, VoidCallback? onDismissed}) PersistentSnackbarController
Shows a persistent snackbar (stays until dismissed)
showSnackbar(BuildContext context, SnackbarConfig config) Future<SnackbarResult?>
Shows a snackbar with the specified configuration
showSuccess({required BuildContext context, required String message, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows a success snackbar with message
showToast({required BuildContext context, required String message, SnackbarPosition position = SnackbarPosition.center, Duration duration = const Duration(seconds: 2)}) Future<SnackbarResult?>
Shows a toast-style snackbar
showWarning({required BuildContext context, required String message, Duration? duration, VoidCallback? onDismissed}) Future<SnackbarResult?>
Shows a warning snackbar with message
toString() String
A string representation of this object.
inherited
updateBehaviorSettings({int? maxQueue, int? maxSimultaneous, SnackbarBehavior? defaultBehavior}) → void
Updates behavior settings for the manager
updateMessage(String snackbarId, String newMessage) bool
Updates the message of an existing snackbar
updateProgress(String snackbarId, double progress) bool
Updates the progress of an existing loading snackbar
updateSnackbarConfig(String snackbarId, {String? message, IconData? icon}) bool
Updates the message and icon of an existing snackbar

Operators

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