avocado_toast 0.1.0 avocado_toast: ^0.1.0 copied to clipboard
A Flutter Plugin for generating custom Android Toasts, completely in Dart code (no channels).
[0.1.0] - 06/16/2018 #
- Initial release.
- Current features:
Toastable()
Widget (as abody
argument for aScaffold
widget), for wrapping Material child widgets, and accepts two arguments:toastController
parameter (mandatory), which accepts aToastController
instance (see below)child
parameter (mandatory), the child of theScaffold
widget, and the widget upon which one wishes to fire off a Toast
ToastController()
constructor, which accepts aState
argument as a parameter (mandatory)show()
method, to fire off a Toast:text
parameter, for passing Strings (do not use if you only want to create a custom widget)widget
parameter, for passing Widgets (do not use if you only want to make a classic toast)toastLength
parameter (mandatory), which accepts one of only two constants for duration:ToastLength.SHORT
- duration of 2.0 secondsToastLength.LONG
- duration of 3.5 seconds
- Current limitations:
- Should only be used with Android apps (no alert option for iOS)
- Widget position is anchored close to the bottom of the screen (great for classic toasts, but limits placement of custom widgets, i.e. images, buttons, videos, gifs, etc.)
- Currently queued toasts do not survive moving between routes
- Improvements planned for next release:
- Sustain toasts between state/route changes
- allow more positional composition for custom widgets