Toaster class

Runs on dart side this has no interaction with the Native Side Works with all platforms just in two lines of code final toaster = Toaster().init(context) toaster.showToast(child)

Constructors

Toaster()
factory

Properties

context BuildContext?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

init(BuildContext context) Toaster
Take users Context and saves to available
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeCustomToast() → void
If any active toast present call removeCustomToast to hide the toast immediately
removeQueuedCustomToasts() → void
Toaster maintains a queue for every toast if we called showToast for 3 times we all to queue and show them one after another
show(String message, {Duration? toastDuration, TextStyle? textStyle}) Future<void>
showToast({required Widget child, required PositionedToastBuilder positionedToastBuilder, Duration toastDuration = const Duration(seconds: 2), ToastGravity? gravity, int fadeDuration = 350}) → void
showToast accepts all the required paramenters and prepares the child calls _showOverlay to display toast
toString() String
A string representation of this object.
inherited

Operators

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