ToastificationItem class

class to define the toastification item this class is the base model for the toastification item

  • do not create an instance of this class directly Toastification class is responsible for creating an instance of this class

this class will be returned when you call show or showCustom methods

you can also use this class to control the toastification items

Constructors

ToastificationItem({required ToastificationBuilder builder, required Alignment alignment, ToastificationAnimationBuilder? animationBuilder, Duration? animationDuration, Duration? autoCloseDuration, void onAutoCompleteCompleted(ToastificationItem holder)?})

Properties

alignment Alignment
the alignment of the toastification item this alignment will be used to define the position of the toastification item in the screen
final
animationBuilder ToastificationAnimationBuilder?
the animation builder of the toastification item
final
animationDuration Duration?
the animation duration of the toastification item animation
final
autoCloseDuration Duration?
the duration of the auto close timer if the autoCloseDuration is provided then the timer will be created and the toastification item will be dismissed automatically after the autoCloseDuration is finished
final
builder ToastificationBuilder
the builder of the toastification item this builder will be used to create the toastification item widget
final
elapsedDuration Duration?
the amount of the time that timer has been running for.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasTimer bool
checks if the autoCloseDuration is provided or not if the autoCloseDuration is provided then the timer will be created
no setter
id String
unique id for the toastification item this id will be used to identify the toastification item
final
isRunning bool
checks if the timer is running or not
no setter
isStarted bool
checks if the timer is started or not
no setter
originalDuration Duration?
The original duration this timer was created with.
no setter
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 setter
timeStatus ToastTimeStatus
the status of the timer
no setter

Methods

addListenerOnTimeStatus(VoidCallback listener) → void
add a listener to the timer status notifier
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
pauses the timer
removeListenerOnTimeStatus(VoidCallback listener) → void
remove a listener from the timer status notifier
start() → void
starts the timer
stop() → void
stops the timer
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited