FabrikSnackbarConfig class

Configuration for displaying a FabrikSnackbar.

This class allows you to customize the appearance, behavior, and layout of a snackbar including its position, content, styling, and dismissal behavior.

Constructors

FabrikSnackbarConfig.new({String? title, String? message, Widget? titleText, Widget? messageText, Widget? icon, Widget? actionButton, Duration duration = const Duration(seconds: 3), Color backgroundColor = const Color(0xFF323232), Gradient? backgroundGradient, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8)), EdgeInsets margin = const EdgeInsets.symmetric(horizontal: 16, vertical: 8), EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12), double? maxWidth, FabrikSnackbarPosition position = FabrikSnackbarPosition.bottom, FabrikSnackbarStyle style = FabrikSnackbarStyle.floating, FabrikSnackbarDismissDirection dismissDirection = FabrikSnackbarDismissDirection.vertical, bool safeArea = true, bool showProgressIndicator = false, Color? progressIndicatorColor, double barrierBlur = 0.0, Color? barrierColor, bool blockBackgroundInteraction = false, VoidCallback? onTap, VoidCallback? onDismissed})
const

Properties

actionButton Widget?
Optional action button (e.g. a TextButton) shown at the end.
final
backgroundColor Color
Background color of the snackbar (used if no backgroundGradient is provided).
final
backgroundGradient Gradient?
Optional background gradient (overrides backgroundColor if set).
final
barrierBlur double
Amount of background blur to apply behind the snackbar. Set to 0 to disable blur.
final
barrierColor Color?
Background color behind the snackbar if blockBackgroundInteraction is true.
final
blockBackgroundInteraction bool
Whether to block user interaction with background widgets.
final
borderRadius BorderRadius
Corner radius of the snackbar (used when style is FabrikSnackbarStyle.floating).
final
dismissDirection → FabrikSnackbarDismissDirection
Direction in which the snackbar can be dismissed.
final
duration Duration
How long the snackbar stays visible before auto-dismiss.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Optional leading icon shown before title/message.
final
margin EdgeInsets
Outer margin around the snackbar.
final
maxWidth double?
Maximum width of the snackbar (especially useful for larger screens).
final
message String?
Message text as a simple String.
final
messageText Widget?
Custom widget for message. Overrides message if provided.
final
onDismissed VoidCallback?
Callback invoked when the snackbar is dismissed.
final
onTap VoidCallback?
Callback invoked when the snackbar is tapped.
final
padding EdgeInsets
Inner padding within the snackbar container.
final
position → FabrikSnackbarPosition
Whether to display the snackbar at the top or bottom of the screen.
final
progressIndicatorColor Color?
Color of the progress indicator (if shown).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeArea bool
Whether to respect SafeArea paddings (e.g. avoid notches).
final
showProgressIndicator bool
Whether to show a progress indicator below the message.
final
style → FabrikSnackbarStyle
Snackbar layout style — floating or grounded.
final
title String?
Title text as a simple String.
final
titleText Widget?
Custom widget for title. Overrides title if provided.
final

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