butter_toast 0.2.1
butter_toast: ^0.2.1 copied to clipboard
Smooth, buttery toasts for Flutter: pill and Sonner-style card toasts, 7 positions with their own motion, promise toasts, swipe to dismiss, no context needed.
0.2.1 #
- Added a Buy Me a Coffee link (
fundingin pubspec and a Support section in the README).
0.2.0 #
- Action buttons:
action: ButterToastAction('Undo', onPressed: ...)adds a button to a toast. Pressing it dismisses the toast unlessdismissOnPressis false. Works on loading toasts too, for a Cancel. onDismissis called once when a toast starts to leave, with aButterToastDismissReason:timeout,swipe,action,closeButton,programmatic,replacedorlimit.- Close button:
showCloseButton: trueon a toast, orButterToastTheme(showCloseButton: true)for all of them. ButterToast.dismiss(tag: ...)dismisses toasts by their tag.ButterToastTheme.mergeDuplicates: set it to false to let identical toasts show side by side. Toasts with an action oronDismissare never merged, since each has its own callbacks.- VoiceOver reads toasts on iOS. The toast's live region now carries its text as its label, which iOS needs in order to announce it. Buttons on a toast stay separate, focusable elements.
0.1.0 #
- 🎉 Initial release.
ButterToast.show,success,error,warning,infoandloading, callable from anywhere onceButterToast.init()is added to the app.- Two styles: a compact pill and a Sonner-style card that stacks and spreads out on tap or hover.
- Seven positions, each with its own motion: top and bottom slide from their edge, corners slide in from the side, centre scales in.
- Spring animations, swipe to dismiss in any direction (even a toast in the middle of a spread-out stack), and smooth morphing when a toast updates.
- A spread-out stack pauses its timers and closes again on a tap outside or after 5 seconds without a touch.
- Repeated identical toasts merge; a
tagupdates a toast in place. ButterToastAppIconshows the app's launcher icon, read at run time (on the web, from the web app manifest);icon,typeIconsandshowIconcontrol toast icons.ButterToast.promiseturns one toast from loading into success or error.- Height budget with "Show more" for long text; keeps clear of the safe area and the keyboard, and shows above dialogs and bottom sheets.
ButterToastThemeas aThemeExtension, atheme:parameter to style a single toast, andButterToast.customfor fully custom toasts.
