Skip to main content

just_sonner 0.1.0 copy "just_sonner: ^0.1.0" to clipboard
just_sonner: ^0.1.0 copied to clipboard

Stacking toasts for Flutter desktop in the spirit of sonner: a deck that fans out on hover, toasts updated in place, promise toasts, no BuildContext.

0.1.0 #

First release. Desktop only: Windows, macOS and Linux.

  • Toasts from anywhere. toast.show needs no BuildContext and returns a ToastId. update changes a toast field by field; show at the id of a toast on screen replaces its content whole. Either way the toast keeps its place and counts down again. dismiss and dismissAll take toasts away.
  • promise. One toast for the whole of a future: loading, then its result or its error. The future's own value or error goes back to the caller unchanged.
  • Two mount modes. toast.attach(navigatorKey) draws the toasts in the root navigator's overlay, above dialogs and pages. SonnerHost wraps the app from MaterialApp.builder.
  • The deck. Toasts stack into a deck that draws visibleToasts of them and fans out, every toast drawn, while the pointer is over it. Six positions; width, gap and offset.
  • Timers pause while the pointer is over the deck, while a toast is dragged, and while the app is hidden. Toasts beyond the deck's window count down like the rest.
  • Swipe to dismiss, in the directions the position names or the ones swipeDirections gives.
  • A default look that follows the theme, light and dark, with a leading slot, an action slot, a close button, and a spinner while a toast loads. dismissible governs every way a user dismisses a toast.
  • A builder that replaces the whole look, per toast or for every toast, handed a ToastView: the toast's state, its animation, how much the deck covers it, its time left, and dismiss.
  • Time left, drawn by the default look as a border, a bar, or a ring, each with settings of its own (config.timeLeft).
  • A cap on the expanded deck (config.deckCap, 400 px by default), past which the toasts scroll, with a draggable scrollbar beside them (config.scrollbar).
  • Dismiss all from the deck (config.dismissAll): a pill or a header, or the app's own control through a builder.
  • Stow the deck: stow() puts it out of sight, keeping its toasts, until the next new toast or unstow() brings it back. A control on the deck (config.stowControl), a motion (config.stowMotion) and a handle left at the edge (config.stowHandle), each with built-in looks and a builder.
  • Changing the config with toasts on screen, which the deck follows in place.
1
likes
0
points
624
downloads

Publisher

verified publisherkihyun1998.com

Weekly Downloads

Stacking toasts for Flutter desktop in the spirit of sonner: a deck that fans out on hover, toasts updated in place, promise toasts, no BuildContext.

Repository (GitHub)
View/report issues

Topics

#toast #notification #snackbar #overlay #desktop

License

unknown (license)

Dependencies

flutter

More

Packages that depend on just_sonner