layerman 0.1.0
layerman: ^0.1.0 copied to clipboard
Flutter-native overlay queue manager: serial one-at-a-time queueing with priority, replace, overlap, cooldown and two-phase close; also orchestrates showDialog / GetX / bot_toast.
0.1.0 #
OverlayNavigatorObserver— aNavigatorObserverthat feeds real navigation intosetContext'sroutekey automatically (deferred to a post-frame callback, safe even if navigation happens mid-build). Works under vanillaNavigator, GetX and go_router alike; purely observational, never touches navigation itself. Removes the need to callsetContext({'route': ...})by hand in every page's lifecycle.OverlayManager.currentRoute— reads the trackedroutecontext value back, so hosts don't need to maintain their own route mirror.OverlayManager({pauseOnRoutes: [...]})— declares "no-overlay zone" route patterns: entering a match freezes the whole queue (likepauseAll), leaving resumes it (likeresumeAll). Composes correctly with manualpauseAll/resumeAll— neither one overrides the other; the queue only actually thaws once both are clear.- README: new "Auto route awareness" section and a "navigated page as a queue
entry" recipe (wrapping
Navigator.pushinpresent:— a page route is just another external presenter, nobuilder:needed).
0.0.1 #
Initial public release.
A Flutter-native overlay queue manager that renders real OverlayEntrys and
can also orchestrate overlays rendered by other libraries (showDialog, GetX,
bot_toast, fluttertoast, …).
Core
OverlayManager— serial one-at-a-time queueing per namedslot, with an optionalgap;open<T>()returns aFuture<T?>(likeshowDialog).- Ordering:
priority(desc, FIFO ties),replace(preempt the current overlay — which is sent back to the queue and re-shows after the replacer closes; front-bands ahead of queued entries; skips a pending gap),affix(protect the current overlay fromreplace),overlap(bypass the queue and stack immediately, now-or-never). - Two-phase close (
OverlayPhase.open→closing→ removed) for exit animations, driven byOverlayHandle.phaseListenable. - Per-overlay
delay/duration(auto-close) and an optional modal barrier (barrierColor/barrierDismissible).
Conditions & cooldown
- Conditions:
when(ctx)predicate (sole authority),route(String/List/RegExp) +requiresAuthsugar,setContext({...})push-model re-evaluation, anddismissWhenUnmet(default true) auto-dismissal. - Cooldown:
OverlayCooldown(session/total/day/hour/minute/minGap)— AND semantics, counts on real open, local calendar buckets, rollingminGap; persisted via a pluggableOverlayCooldownStorage(defaultMemoryCooldownStorage);ready()awaits hydration; injectablenow. A time-based cap (minGap/ bucket rollover) auto-shows the queued entry the moment it expires.
Lifecycle & data
- Backend-driven
resolve(fetch payload only when granted;nullskips without counting cooldown; slot committed while resolving). beforeCloseguard (sync/async;falseor throw vetoesclose;remove/clearbypass it).pauseAll/resumeAllfull freeze and per-idpause/resume.update(id, patch)(shallow-merge + rebuild) andclearWhere(test)(selective mass removal overOverlayRecords).- Introspection:
activeIds,queuedIds,isShowing,isPaused,isAttached;OverlayManageris aChangeNotifier.
Rendering & orchestration
OverlayManagerScope— a dedicatedOverlaylayer above your app (independent of theNavigator), withof/maybeOfand automatic re-attach when the manager is swapped. Orattach/detachan ambientOverlayyourself.- External presenter:
open(present: ...)withPresent/PresentContext/PresentedOverlay— one queue overshowDialog/ GetX (dialog + snackbar) /bot_toast/fluttertoast. README has copy-paste recipes and the orchestration rules of engagement.
Zero third-party runtime dependencies.