ToastificationConfig class

you can use ToastificationConfig class to change default values of Toastification

when you are using show or showCustom methods, if some of the parameters are not provided,

Toastification will use this class to get the default values.

to provide the ToastificationConfig to the widget tree you can use the ToastificationConfigProvider widget.

Constructors

ToastificationConfig({AlignmentGeometry alignment = defaultAlignment, double itemWidth = defaultWidth, Clip clipBehavior = defaultClipBehavior, Duration animationDuration = defaultItemAnimationDuration, ToastificationAnimationBuilder animationBuilder = defaultAnimationBuilderConfig, ToastificationMarginBuilder marginBuilder = defaultMarginBuilder, bool applyMediaQueryViewInsets = true, int maxToastLimit = 10, int maxTitleLines = 2, int maxDescriptionLines = 6, bool blockBackgroundInteraction = false})
const

Properties

alignment AlignmentGeometry
final
animationBuilder ToastificationAnimationBuilder
final
animationDuration Duration
The duration of the animation for ToastificationItems. The default value is 600 milliseconds.
final
applyMediaQueryViewInsets bool
Whether to apply the viewInsets to the margin of the Toastification Overlay. Basically, this is used to move the Toastification Overlay up or down when the keyboard is shown. So Toast overlay will not be hidden by the keyboard when the keyboard is shown.
final
blockBackgroundInteraction bool
Whether to block background interaction. If set to true, the background will not be interactive. The default value is false.
final
clipBehavior Clip
The ClipBehavior of AnimatedList, used as entry point for all ToastificationItems' widgets under the hood. The default value is Clip.none.
final
hashCode int
The hash code for this object.
no setterinherited
itemWidth double
final
marginBuilder ToastificationMarginBuilder
Builder method for creating margin for Toastification Overlay.
final
maxDescriptionLines int
The maximum number of lines to display for the toast description. If the description exceeds this number of lines, it will be truncated with an ellipsis. The default value is 2.
final
maxTitleLines int
The maximum number of lines to display for the toast title. If the title exceeds this number of lines, it will be truncated with an ellipsis. The default value is 2.
final
maxToastLimit int
The maximum number of toasts that can be displayed at the same time. If the number of toasts exceeds this limit, the oldest toast will be removed. The default value is 10.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

copyWith({AlignmentGeometry? alignment, double? itemWidth, Clip? clipBehavior, Duration? animationDuration, ToastificationAnimationBuilder? animationBuilder, ToastificationMarginBuilder? marginBuilder, int? maxToastLimit, bool? applyMediaQueryViewInsets, bool? blockBackgroundInteraction}) ToastificationConfig
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