layerman 0.0.1
layerman: ^0.0.1 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.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.