SnackbarConfig class
Configuration options for customizing snackbars
Constructors
- SnackbarConfig({Duration duration = const Duration(seconds: 3), SnackbarPosition position = SnackbarPosition.bottom, Color? backgroundColor, Color? textColor, IconData? icon, Color? iconColor, String? actionLabel, VoidCallback? onActionPressed, Color? actionTextColor, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8)), EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 0), EdgeInsets margin = const EdgeInsets.all(16), Duration animationDuration = const Duration(milliseconds: 250), double? maxWidth, double? minWidth, double elevation = 6, bool showCloseButton = false, SnackbarAnimationType animationType = SnackbarAnimationType.slideUp})
-
Creates a configuration for custom snackbars
const
Properties
- actionLabel → String?
-
The optional action button text
final
- actionTextColor → Color?
-
The color of the action button text
final
- animationDuration → Duration
-
The animation duration for entry and exit
final
- animationType → SnackbarAnimationType
-
Custom animation type
final
- backgroundColor → Color?
-
The background color of the snackbar
If null, will use type-specific default colors
final
- borderRadius → BorderRadius
-
The border radius of the snackbar
final
- duration → Duration
-
The duration for which the snackbar will be displayed
final
- elevation → double
-
The elevation (shadow) of the snackbar
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
The icon to display in the snackbar
If null, will use type-specific default icons
final
- iconColor → Color?
-
The color of the icon
If null, will use type-specific default colors
final
- margin → EdgeInsets
-
The margin around the snackbar
final
- maxWidth → double?
-
The maximum width of the snackbar
final
- minWidth → double?
-
The minimum width of the snackbar
final
- onActionPressed → VoidCallback?
-
The callback when the action button is pressed
final
- padding → EdgeInsets
-
The padding inside the snackbar
final
- position → SnackbarPosition
-
The position of the snackbar on the screen
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCloseButton → bool
-
Whether to show a close button
final
- textColor → Color?
-
The text color for the snackbar message
If null, will use type-specific default colors
final
Methods
-
copyWith(
{Duration? duration, SnackbarPosition? position, Color? backgroundColor, Color? textColor, IconData? icon, Color? iconColor, String? actionLabel, VoidCallback? onActionPressed, Color? actionTextColor, BorderRadius? borderRadius, EdgeInsets? padding, EdgeInsets? margin, Duration? animationDuration, double? maxWidth, double? minWidth, double? elevation, bool? showCloseButton, SnackbarAnimationType? animationType}) → SnackbarConfig - Creates a copy of this configuration with the given fields replaced
-
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