unified_popups 2.0.6
unified_popups: ^2.0.6 copied to clipboard
Unified Overlay popup system for Flutter: toast, loading, confirm, date, sheet, flow sheet, menu and drop menu. One Pop API, no BuildContext, shared back and route policies.
Changelog #
Notable changes to unified_popups. Versions follow Semantic Versioning.
2.0.6 #
Fixes #
PopupScene/ toast lanes now putValueKey(entry.id)on the outerOffstageStack/Column child (not only on the inner animated entry). Removing an earlier sibling no longer remounts later entries, which previously replayed enter animations or snapped exit animations to zero (e.g. dismiss menu then open sheet, or dismiss a lower entry while an upper one is exiting).
Docs #
- Clarified in
ARCHITECTURE.mdthat Entry keys must sit on the Scene's direct layout children for identity to survive sibling removal.
2.0.5 #
Features #
FlowSheetNavigator.popToRoot([result])— pop the inner stack to the root page without closing the sheet (no-op when already on root). Topmost waiter receivesresult; intermediate pages complete withnull.
Docs #
- Documented
popToRootacross API reference, architecture, migration guide, READMEs, example README, and consumer skill. - Rewrote
CLAUDE.mdfor the v2 Runtime/Controller/Host model (removed stale PopupManager guidance). - Updated
AGENTS.md: correctlib/srclayout,doc/paths, and a docs checklist that forbids backfilling changelog into already-published versions.
2.0.4 #
Features #
PopupBarrierConfig.dismissOnDrag— whendismissibleis true, drag/swipe on the barrier dismisses the popup (gesture consumed, not forwarded).- Menu / DropMenu default barrier sets
dismissOnDrag: trueso outside drag closes like a tap, without scrolling content underneath.
Docs #
- Documented
dismissOnDragin API reference; clarified Menu barrier defaults.
2.0.3 #
Fixes #
- Fixed
PopupAnimationType.none: aftermarkPresented, animation stayed at0, so the barrier faded out while content remained visible. - FlowSheet system back now asks the current page before default pop/close, and
the type API no longer re-enters
handleBackwhen the stack can pop.
Features #
FlowSheetPageState.onBack()— returntrueto consume back and block default inward pop / sheet dismiss.Pop.interceptsSystemBack— sync flag for page-levelPopScopeso it does not race the global route back bridge on the same event.SheetDragDismissMode.disabledandFlowSheetNavigator.updateDragDismissMode()for dynamic drag-dismiss control.- Exported
popup_entry_animation.dartfrom the package entry.
Docs #
- Added consumer usage skill at
skills/unified-popups-usage/: wrap in an app-level facade (AppPop), read docs on demand, keep Handle/Config out of business code. Linked from README / README_EN.
2.0.2 #
Features #
- Added pause/resume for temporary overlay hang:
PopupHandleBase.pause()/resume()/isPausedPop.pauseLatest(PopupChannel)/Pop.resume(id)
- Paused entries stay mounted (Offstage + IgnorePointer) so FlowSheet / form state survives; they skip system back and route auto-dismiss.
Pop.isVisibleKeyreturnsfalsewhile paused;hasChannelstill counts the active paused entry.- Example Lab: Pause / Resume.
Docs #
- Documented pause/resume in API reference and README.
2.0.1 #
Fixes #
- Fixed FlowSheet system back: nested Navigator
NavigationNotificationno longer reportscanHandlePop: false(which made Android finish the app). Back is owned by the route observer → popup controller → flowSheetdelegatepath, so confirm-on-top blocks and multi-page stacks pop inward first. - DropMenu nested section expand/collapse no longer uses
SizeTransition.alignment(Flutter 3.41+) or deprecatedaxisAlignment; usesClipRect+Alignsoflutter >= 3.24stays warning-free.
Docs #
- Expanded README capability / use-case gallery (including Loading preview).
- Added README_EN.md with cross-links between Chinese and English.
2.0.0 #
Architecture #
- Replaced the old
PopupManager, navigatorKey bootstrap, and one-fullscreen- OverlayEntry-per-popup model withPop + PopupRuntime + PopupController + PopupHost. - Introduced per-capability Config/Renderer pairs and a unified
PopupHandlethat separates business outcome from visual removal. - Removed
AnimationControllerPool, the monolithicPopupConfig,PopupType-driven behavior,PopScopeWidget, the legacy route observer, and the oldpart-file API surface. - Apps only need
Pop.hostBuilderandPop.routeObserver; business calls stay global and context-free.
Lifecycle and management #
- Every capability now has exactly one
Pop.xxx(Config)entrypoint. AllopenXxxhelpers and loose parameter overloads were removed. Config is the only public parameter contract;PopupTypeApiis an internal adapter. - All open APIs return
PopupOpenResult<T>with a.resultconvenience getter, covering opened, updated, toggledClosed, and rejected. Opening decisions are no longer disguised as entry dismiss reasons. - Narrowed the package export surface:
PopupRuntime,PopupController,PopupHost,PopupScene, and renderer base types are no longer stable public API. PopupBehaviorConfigno longer accepts channel; each capability fixes its own channel to avoid invalid Config/channel combinations.PopupLifetime.untilnow observes Future settlement: success or failure both dismiss withexternalEvent, while business errors remain the caller's responsibility.- PopupController splits entry records, handle implementations, and lifetime resources into internal modules; the controller remains the sole state and transition authority.
- Added key, channel, tags, plus conflict, route, back, ownership, barrier, auto-dismiss, and lifecycle policies.
- Added
PopupOutcomeand a completePopupDismissReasonset. - Added dismiss APIs by handle, top entry, channel, tags, and all popups.
- Calls before Host mount enter
pendingHostand resume when Host is ready. - Toast shows at most three items per position; extras queue FIFO without starting lifetime until presented.
Capability features #
- Standard DropMenu uses a default global key +
replaceExisting, including across result generics, so only one standard DropMenu is visible at a time. - Added themed liquid-glass widgets and data-driven
Pop.dropMenuwith single or nested sections, system/custom check icons, disabled items, keep-open settings rows, and full color overrides. - DropMenu default width is 140–240; the last item drops its bottom divider.
Liquid glass lowers default background opacity and adds
topHighlightColorindependent of the normal border. - Nested sections animate size + fade; selecting a nested option collapses only
that section while the outer menu stays open, notifying via
onSelected/ itemonTap. - DropMenu fades only text/icons on open so BackdropFilter stays opaque and
avoids an end-frame blur pop from a parent OpacityLayer. BackdropFilter still
uses
BlendMode.srcas an extra guard. Generic LiquidGlass keepssrcOver. - Menu
autoplacement measures real menu size, then chooses direction from SafeArea, offset, and edge overflow, locking that direction for the session. - Fixed Menu follower hit-testing under a transparent visible barrier so menu content receives taps while outside taps still dismiss via the barrier.
- Loading updates keep the same logical entry and handle, restarting lifetime from the new config.
- Loading uses mutually exclusive
indicator/text/contentconstructors; Confirm and Sheet header reject providing both String and Widget for the same payload. - Toast and Loading support countdown, external Future, manual handle dismiss, or combined lifetime conditions.
- Confirm adds button-specific
onConfirm/onCancelwhile keeping theFuture<bool?>business result. - Confirm defaults to edge-to-edge divider buttons
(
ConfirmButtonStyle.divider); useConfirmButtonStyle.filledfor rounded / capsule buttons, withdividerColor,dividerWidth, andbuttonSpacing. - Confirm defaults to strong modal interaction:
backPolicy: block,barrier.dismissible: false, andshowCloseButton: false. Only confirm / cancel buttons close it unless those options are opened explicitly. - Sheet and FlowSheet share a four-direction renderer, drag progress, and exit animation; heavy child trees are not rebuilt on every drag pointer update. Drag handles render only for the bottom direction.
- Restored dual SafeArea for Sheet (alignment layer subtracts status bar + panel always SafeArea), fixing full-height bottom sheets under the notch and top/left/right content colliding with the status bar.
- FlowSheet attaches to the unified outer handle while keeping its internal page stack, page results, and lifecycle hooks.
- Menu uses
PopupAnchorController + PopupAnchor, follows scroll/layout, and auto-dismisses when the anchor unmounts. Default barrier is transparent (same as DropMenu: tap outside to dismiss, block underlying scroll). PassPopupBarrierConfig.hidden()when the page must keep scrolling under the menu. - Added
CustomPopupConfigso custom content joins the shared lifecycle and global management.
Example and docs #
- FitPulse product area adds an app-level
AppPopfacade for brand defaults and simple business returns; product flows cover Toast, Loading, Confirm, Date, Sheet, FlowSheet, Menu, DropMenu, and Custom. The API Lab keeps raw SDK contracts. - Rewrote guidance for
PopupOpenResult,.result,requireHandle(), builder handles, outcome, and dismissed timing. - Example adds Toast/Loading
untilfailure dismiss, unifiedPopupOpenResult, and DropMenu global-replace checks. - Detailed docs converge on architecture, full API reference, and v1/v2 migration.
- Added WHY_OVERLAY.md: Overlay unified popups vs official
showDialog/showModalBottomSheet(call site, route stack, multi-type governance, back/route policies, and when native dialogs are enough). - README embeds architecture, lifecycle, and usage diagrams from
doc/images/. - Menu Lab adds single-level filter and nested settings examples.
- FitPulse example fully migrated to v2.
- Example launch screen offers dual entry: FitPulse app / API gallery, plus a shared Config page for the Config-first single entrypoint.
- Loading with text sizes to content;
LoadingConfig.positioncan stagger multiple instances. - Tech lab pages cover the full capability matrix; business tabs keep real product usage.
- Confirm Lab contrasts divider vs filled button styles.
- Rewrote README, API reference, architecture notes, and the v1 → v2 migration guide. Project usage docs are Chinese.
1.3.0 #
FlowSheet #
- Added
Pop.flowSheetwith internalpush,pop,replace,completeCurrent, andcloseAll. - Added
FlowSheetController,FlowSheetPage,FlowSheetPageState, and page lifecycle hooksonLoad,onShow,onHide,onRemove,onClose. - Supported per-page drag modes and custom internal route builders.
Sheet and routing #
- Added
fullBody,contentWhenAtTop, andhandleOnlydrag modes. - Sheet gained drag handle, keyboard avoidance, dynamic drag mode, and back callbacks.
- Route observer also cleans popups on route remove.
- Example added FitPulse product flows and a tech lab.
1.2.2 #
- Narrowed rebuild scope for legacy
PopScopeWidget. - Experimented with an AnimationController pool; removed in v2 due to lifecycle risk.
- Optimized legacy Menu RenderBox and screen-size reads.
1.2.1 #
- Toast added
messageWidget. - Confirm added custom title, content, and button widgets.
- Sheet added
titleWidget. - Confirm added
onConfirmandonCancel.
1.2.0 #
- Added animation duration and curve options per type.
- Added legacy
PopupRouteObserverand route-change cleanup. - Improved Sheet animation clipping, edge docking, keyboard handling, and async build-phase safety.
- Toast added tap toggle and custom tap callbacks.
- Menu added padding, constraints, and decoration.
1.1.17 #
- Fixed known popup interaction issues.
1.1.16 #
- Fixed Sheet animation clipping overflow.
1.1.15 #
- Fixed residual hit areas after popup dismiss.
1.1.14 #
- Fixed leftover untappable regions after repeated Loading calls.
1.1.13 #
- Toast added secondary-state text, image, type, color, and tap-toggle.
1.1.12 #
- Improved legacy base popup behavior.
1.1.11 #
- Fixed
setStateerrors from inserting Overlay during build.
1.1.10 #
- Simplified Loading API.
- Added batch dismiss by legacy
PopupType.
1.1.9 #
- Menu added padding, constraints, and decoration.
1.1.8 #
- Sheet added
dockToEdgeandedgeGap.
1.1.7 #
- Fixed Sheet interaction with bottom UI regions.
1.1.6 #
- Toast added custom image tinting.
1.1.5 #
- Confirm buttons gained custom borders.
1.1.4 #
- Toast added custom local images, image size, and horizontal/vertical layout.
- Loading added a custom rotating indicator.
1.1.3 #
- Improved base popup presentation.
1.1.2 #
- Applied keyboard avoidance padding only for bottom sheets.
1.1.1 #
- Fixed base style and layout issues.
1.1.0 #
- Introduced the unified
Popentry facade. - Unified management for Toast, Loading, Confirm, Sheet, Date, and Menu.
1.0.3 and earlier #
- Initial release and base popup capabilities.