SmartStateSnackbarConfig class

Configuration class for snackbar customization

Provides comprehensive control over snackbar behavior, positioning, styling, and interaction for error and success messages.

Example:

SmartStateSnackbarConfig(
  position: SnackbarPosition.top,
  behavior: SnackBarBehavior.floating,
  duration: Duration(seconds: 4),
  showCloseIcon: true,
  errorConfig: SnackbarStateConfig(
    backgroundColor: Colors.red,
    textColor: Colors.white,
  ),
)
Annotations

Constructors

SmartStateSnackbarConfig({SnackbarPosition position = SnackbarPosition.bottom, SnackBarBehavior behavior = SnackBarBehavior.fixed, Duration duration = const Duration(seconds: 3), bool showCloseIcon = false, Color? closeIconColor, EdgeInsets? margin, EdgeInsets? padding, double? width, DismissDirection dismissDirection = DismissDirection.down, SnackbarStateConfig errorConfig = const SnackbarStateConfig(backgroundColor: Color(0xFFD32F2F), textColor: Colors.white, icon: Icons.error_outline), SnackbarStateConfig successConfig = const SnackbarStateConfig(backgroundColor: Color(0xFF388E3C), textColor: Colors.white, icon: Icons.check_circle_outline), SnackbarStateConfig loadingConfig = const SnackbarStateConfig(backgroundColor: Color(0xFF1976D2), textColor: Colors.white, icon: Icons.info_outline), VoidCallback? onTap, VoidCallback? onVisible})
const

Properties

behavior → SnackBarBehavior
Behavior of the snackbar (fixed or floating)
final
closeIconColor → Color?
Color of the close icon
final
dismissDirection → DismissDirection
Direction to swipe to dismiss
final
duration → Duration
How long the snackbar should be visible
final
errorConfig → SnackbarStateConfig
Configuration for error state snackbar
final
hashCode → int
The hash code for this object.
no setterinherited
loadingConfig → SnackbarStateConfig
Configuration for loading state snackbar
final
margin → EdgeInsets?
Margin around the snackbar
final
onTap → VoidCallback?
Callback when snackbar is tapped
final
onVisible → VoidCallback?
Callback when snackbar becomes visible
final
padding → EdgeInsets?
Padding inside the snackbar
final
position → SnackbarPosition
Position of the snackbar on screen
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showCloseIcon → bool
Whether to show a close/dismiss icon
final
successConfig → SnackbarStateConfig
Configuration for success state snackbar
final
width → double?
Width of the snackbar (for floating snackbars)
final

Methods

getConfigForState(SnackbarType type) → SnackbarStateConfig
Get configuration for specific state
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