queued_toast 1.1.0
queued_toast: ^1.1.0 copied to clipboard
Overlay toasts for Flutter that queue per screen position, de-duplicate identical messages, stack up to five at a time and fade in and out.
1.1.0 #
Toast.showreturns aToastHandle, so a single toast can be dismissed (handle.dismiss()) or checked (handle.isActive) without touching the whole stack.- Interaction:
onTap,dismissOnTap,dismissOnSwipe, and an optional trailing action button viaactionLabel+onAction. A toast with none of these is wrapped in anIgnorePointer, so it never steals a tap from the screen underneath. onDismissed, called once the card has left the screen, however it went.duration: Duration.zerokeeps a toast up until something dismisses it.maxLines, capping how far the description wraps before it ellipsizes.Toast.dismissAll({position})animates everything out,Toast.reset()removes it all without animating, andToast.visibleCount/Toast.queuedCountreport the state of a stack.Toast.maxVisiblemakes the five-toast cap configurable.- Toasts are announced to screen readers, and honour the platform's "reduce motion" setting by skipping the slide and fade.
ToastThemeis nowconst-constructible and exposesblurSigma,borderWidth,backgroundOpacityandspacing.- Dropped the
equatabledependency; the package now has no third-party dependencies at all. - Fixed toasts raised in the same frame replacing each other instead of stacking, and timers outliving a dismissed toast.
- Test suite covering queueing, de-duplication, dismissal, interaction, theming and reduced motion.
1.0.0 #
- Initial release, extracted from an internal application module.
- Dartdoc across the public API, and a runnable example app under
example/covering positions, styles, queueing, de-duplication and per-call overrides. Toast.init/Toast.showstatic API backed by navigator overlay entries.- Per-position queues (
top,center,bottom) with a five-toast visible cap and de-duplication of identical pending or active toasts. - Five styles (
error,success,info,warning,minimal) with default icons and colours. ToastThemewith light/dark background, text and icon colours, title and description text styles, and a mergingcopyWith.offsetonToast.show, setting how far atoporbottomtoast sits from its edge in logical pixels, measured on top ofmarginand the safe area. Left null it falls back to 30% of the screen height.maxWidth, so long messages wrap instead of spanning the screen, and a stack that stays inside the safe area.- Default look: higher-contrast surfaces, a hairline border, a stronger backdrop blur, rounded icons, roomier padding, a 14px radius, and a slide-and-fade transition on an ease-out curve.
- Screenshots and an animated demo on the pub.dev listing and in the README,
rendered headlessly by
tool/generate_media.dartandtool/assemble_gif.py. - Typography tuned for small overlay text, with
ToastThemeknobs forfontFamily,titleLetterSpacing,titleHeight,descriptionFontWeight,descriptionLetterSpacing,descriptionHeight,descriptionOpacity,lightBorderColoranddarkBorderColor.
