capsule_toast 1.1.1
capsule_toast: ^1.1.1 copied to clipboard
A reusable, brand-neutral Flutter package for morphing capsule notifications.
1.1.1 #
- Internal: toast hosting, placement, motion synchronization, and interaction are now composed from focused, Flutter-style widgets instead of one large layer. No public API or observable behavior change.
- docs: expand the README's loading-resolution example into a copy-pastable loading-then-success-or-error flow.
1.1.0 #
CapsuleToastData.expansionPolicylocks a toast toCapsuleToastExpansionPolicy.compactOnlyor.expandedOnly, disabling tap, long-press, and handle-driven mode toggling for toasts whose expanded or compact layout has no meaningful content. Defaults to.adaptive, which is the existing toggle-both behavior — fully backward compatible.
1.0.0 #
Initial release.
CapsuleToastHostinstalls a capsule layer over any subtree. Hosts nest independently, so the package needs no global singleton or navigator key.- Top-centre capsules morph between compact and expanded layouts on interruptible damped-spring motion, with content pinned to the capsule centre as the capsule springs around it.
CapsuleToastTypecovers success, information, warning, error, loading, neutral, and custom content; compact and expanded builders take over layout per mode.CapsuleToastQueuePolicyselects replace, FIFO enqueue, or clear-and-show.CapsuleToastHandleexposes live expand, collapse, resolve, and dismiss commands, and completes with aCapsuleToastResultcarrying aCapsuleToastDismissReason.- Primary, secondary, and compact actions render with themeable button chrome.
CapsuleToastThemeDataandCapsuleToastMotionThemeconfigure appearance and motion. Values resolve from the app brightness, thenThemeData.extensions, then the nearestCapsuleToastTheme, then per-toast overrides.- Light and dark appearances share identical motion, geometry, layout, and typography; the dark appearance adds an inner rim highlight.
CapsuleToastGlyphIconpaints the status glyphs and the loading spinner for custom content builders.- Touch, mouse, keyboard, and RTL input, plus safe areas, large text, and screen-reader semantics.
- Velocity-aware swipe-to-dismiss that exits from wherever the finger released the capsule.
CapsuleToastReducedMotionPolicyandCapsuleToastHapticPolicyadapt motion and feedback to platform settings.