SonnerConfig class
Configuration for the Sonner overlay behavior.
Use this to customize how toasts are stacked, spaced, and positioned. user Sonner class to change the default configuration.
Constructors
- SonnerConfig({double expandedSpacing = 10.0, double collapsedOffset = 13.0, DismissDirection dismissDirection = DismissDirection.horizontal, int maxVisibleToasts = 3, EdgeInsets outerPadding = const EdgeInsets.all(0), EdgeInsets innerPadding = const EdgeInsets.all(0), SonnerVariant? variant, double width = double.infinity, Alignment alignment = Alignment.bottomCenter})
-
const
Properties
- alignment → Alignment
-
Alignment of the toast stack area.
final
- collapsedOffset → double
-
The vertical visual offset between stacked toasts (when collapsed).
final
- dismissDirection → DismissDirection
-
The direction in which toasts can be dismissed by swiping.
final
- expandedSpacing → double
-
The vertical spacing between expanded toasts (when hovering).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- innerPadding → EdgeInsets
-
Padding inside the stack area (inner spacing).
final
- maxVisibleToasts → int
-
The maximum number of toasts visible in the stack at once.
final
- outerPadding → EdgeInsets
-
Padding around the aligned stack area (outer positioning).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- variant → SonnerVariant?
-
The positioning variant (top or bottom)
final
- width → double
-
The width of the toast stack area.
final
Methods
-
copyWith(
{double? expandedSpacing, double? collapsedOffset, int? maxVisibleToasts, EdgeInsets? outerPadding, EdgeInsets? innerPadding, double? width, Alignment? alignment, SonnerVariant? variant, DismissDirection? dismissDirection}) → SonnerConfig -
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.
override