flutter_notification_queue 0.5.0
flutter_notification_queue: ^0.5.0 copied to clipboard
A contextless, overlay-based in-app notification queue for Flutter with spatial positioning, gesture intents, priority triage, notification bundling, and event streams.
Changelog #
0.5.0 - 2026-10-14 #
Architectural Governance & Design System #
- Permanent Queue Relocation: Added
permanentRelocation: QueuePosition?toQueueBehaviorandNotificationQueue. All incoming notifications and pending backlog items are automatically routed to the destination queue. Decoupled relocation strictly to the queue layer (channels have zero relocation logic). - The Four Architectural Tiers: Formalized the separation between Surface Owner (
NotificationScope), Spatial Anchor (NotificationQueue), Domain Routing (NotificationChannel), and Event Payload (AppNotification). QueueStyleStrict Single Ownership:QueueStyle(FilledQueueStyle,OutlinedQueueStyle,FlatQueueStyle) lives strictly onNotificationQueueto govern physical card geometry (borderRadius,padding,elevation,opacityfor glassmorphism). Neither channels nor payloads take styling archetypes.- Parametric Theme Token System (
NotificationThemeData): Introduced unified, dark-mode reactiveNotificationThemeDatadriven parametrically bycolorand Material 3 design tokens, deterministically controlling archetype role distribution with automatic WCAG contrast. - Standardized Box Model Spacing: Standardized
margin(safe-area boundary spacing),spacing(inter-card gap in stacks), andpadding(intra-card content insets). - Contextual Dispatch-Time Routing (
targetPosition): AddedtargetPositionparameter toNotificationController.show(),controller.tryShow(), andQueueCoordinator.show(), enabling callers to specify placement contextually without hardcoding coordinates on data payloads. - Removal of Archiving: Removed phantom
Archive<T>drag intent and plugin. UseDismissor listen toNotificationDismissed/HistoryLogger. - Payload Deprecation Window (v0.5.x → v0.6.0): Marked
AppNotification.position,dragBehavior,longPressDragBehavior,initialIsPinned,snoozedAt, and loose scalar colors as@Deprecatedwith non-breaking fallbacks. - Multi-Window Layout Modernization: Migrated
_QueueOverlayLayoutDelegatefromPlatformDispatcher.instance.implicitViewto context-awareView.maybeOf(context), future-proofing for multi-window Flutter. - Experimental Drag Intents: Annotated
Pin<T>,Snooze<T>, andCustomAction<T>with@experimental.
Studio & Observability (Example App) #
- Live In-Place Draft Card Preview (
LiveCardPreview): Real-time presentational sandbox resolving the 3-gear theme cascade with zero dismiss timers or queue side-effects, featuring an optical checkerboard canvas to highlight glassmorphic transparency. - Live Spatial Stage Radar (
LiveStageRadar): 3×3 spatial radar monitoring active counts, pending counts, and permanent relocations across all 8 queue positions with instant stage controls (Dismiss Newest,Dismiss All). - Global Hardware Keyboard Shortcuts: Bound
Ctrl+Enter(⌘Enter) to fire preview drafts,Ctrl+Eto reset drafts, andCtrl+Lto load random drafts, operating cleanly even when input fields are focused. - Top Cockpit & Single Source of Truth: Consolidated notification firing into the Top Cockpit, eliminating duplicate fire buttons from inner sub-tabs.
- Adaptive Multi-Column Dashboard & Resizable Panes: Added 3-column resizable layout with drag dividers, collapsible sidebars, bounded aesthetic proportions, and an adaptive 660px 2-pane threshold for narrow screens.
- Queue & Channel Geometry Editors: Integrated live radius, elevation, padding, opacity, and margin controls directly into the configurator with real-time code generation.
- Snooze & Pin Studio Integration: Added interactive configurator controls, live preview actions, and dedicated demo scenarios for Snooze duration and Pin toggling.
- Multi-Platform Toolchain: Modernized Gradle build configuration and added unified multi-platform launcher script (
example/scripts/run.sh).
Stability & Resource Hardening #
- Snooze Timer Lifecycle & Leak Protection: Added active timer registry (
_snoozeTimers) toQueueCoordinator. All pending snooze timers are automatically cancelled upon coordinator detach or disposal, and callbacks guard against invoking actions on disposed instances. - Idempotent Lifecycle Disposal: Added
_isDisposedguards and publicisDisposedgetters to bothNotificationControllerandQueueCoordinator, eliminating double-dispose exceptions when controllers and widget scopes unmount in varying orders. - Chained
FlutterError.onErrorHandler: Replaced destructiveFlutterError.onErrorreassignment inNotificationControllerwith non-destructive handler chaining, preserving integration with crash reporters (Sentry, Firebase Crashlytics) and Flutter defaults. - Single Source of Truth for
isPinned: LinkedNotificationEntrydirectly to the blueprint'sisPinnedNotifier, and refactoredpinWidgetandunpinWidgetinQueueCoordinatorto mutate pinned state directly through the notifier. - Robust Detach & Disposal Logging: Replaced empty
on Object catch (_) {}exception swallowing inQueueCoordinatorwith contextual debug logging.
Test Suite & Visual Regression Hardening #
- Tolerant Golden File Comparator: Added
_TolerantGoldenComparatorwith a 0.5% diff tolerance threshold tovisual_regression_test.dartto prevent platform-specific sub-pixel anti-aliasing false positives in CI environments. - Queue Relocation & Backlog Migration Tests: Added test coverage validating queue-level permanent relocation, cluster invariance, and automatic migration of pending/waiting notifications.
- Studio Widget & Adaptability Tests: Added 22 widget tests covering multi-column adaptability, resizable panes, and hardware keyboard shortcuts.
- Lifecycle & Chaining Unit Tests: Added unit tests covering
NotificationControllerandQueueCoordinatordisposal idempotency, snooze timer cancellation on detach/dispose, andFlutterError.onErrorpreservation.
Documentation & Guides #
- v0.5.0 Migration Guide: Published
doc/migration_v0_5.mddetailing the four architectural tiers, breaking changes, permanent queue relocation, and deprecation roadmap. - Module Documentation Updates: Completely modernized
doc/queue/styles.md,doc/queue/README.md, anddoc/channel/README.mdfor v0.5.0 conventions. - NFQ Studio Guide: Overhauled
example/README.mdwith comprehensive feature guides, keyboard shortcuts, and local platform run instructions.
0.4.1 - 2026-09-12 #
Studio & Web Deployment #
- Web Release Display Fix: Fixed an issue in the Studio web app where configurator options and generated code snippets displayed minified type names in web release builds.
0.4.0 - 2026-08-30 #
Breaking API Changes (Deprecated Surface Removal) #
- Removed Legacy Static Singleton Facade: Removed
FlutterNotificationQueuestatic facade.NotificationControllerandNotificationScopeare now the canonical API for all notification queue management. - Removed
FnqEventTypedef: Standardized onsealed class NotificationEventfor all lifecycle event subscriptions. - Removed Legacy Action Factory: Removed
@Deprecated factory NotificationAction.onTap. UseNotificationAction.buttonor gesture intents (TapBehavior,DragBehavior) instead. - Removed
NotificationWidget.show(): Notifications are dispatched asAppNotificationpayloads viacontroller.show(...)orNotificationScope.of(context).show(...).
0.3.2 - 2026-08-26 #
Studio Application & Web Deployment #
- GitHub Pages CI/CD Workflow: Added automated GitHub Actions workflow (
deploy_pages.yml) to compile and deploy the NFQ Studio web app (example/) to GitHub Pages on version tag pushes (v*). - Interactive Web Demo Link: Integrated a prominent
img.shields.iofor-the-badge demo button inREADME.mddirecting users to the hosted NFQ Studio live web app. - Mobile Floating Action Button (FAB): Added a scroll-responsive floating action button in NFQ Studio for narrow screen viewports, enabling instant notification preview triggers on mobile devices.
0.3.1 - 2026-08-14 #
Memory Teardown & Resource Hardening #
- Automated Timer Teardown: Added
ditchAllDismissTimers()toQueueWidgetStateand integrated it intoQueueCoordinator.dispose()to ensure active tickers and auto-dismiss timers across all registered queues stop immediately on coordinator/controller disposal. - Animation Ticker Teardown: Prevented active
_snapBackControlleranimation leaks inDraggableTransitionsStateand invokedditchDismissTimer()prior to disposingNotificationWidgetState. - OverlayPortal Controller Teardown: Ensured
OverlayPortalControllerand scope bindings detach cleanly on widget unmounting.
Test Suite Hardening #
- Multi-Tenant Scope Verification: Added unit and widget test suite in
notification_scope_test.dartcovering multi-tenant subtree isolation, scope nesting overrides, unmount detachment, and graceful timer teardown.
0.3.0 - 2026-08-14 #
Architectural Evolution (v1.0 Preparation) #
NotificationControllerFacade: Introduced an explicitNotificationControllerto own configuration (queues,channels), active state, event streams, and history logging. Replaces global static state with clean dependency injection.NotificationScopeIntegration: IntroducedNotificationScope(StatefulWidget&InheritedWidget) to provide scoped access toNotificationControllerviaNotificationScope.of(context).AppNotificationIntent Payload: Separated data payload from widget rendering state. Applications dispatch immutableAppNotificationpayloads viacontroller.show(AppNotification(...)).- Expanded Controller Surface: Added
show,tryShow,dismiss,dismissAll,dismissNewest,dismissGroup,relocate,reorder,snooze,pin,unpin,getHistory,clearHistory, andeventsdirectly toNotificationController. - Sealed Event Hierarchy: Renamed
FnqEventbase class toNotificationEvent(typedef FnqEvent = NotificationEventprovided for backward compatibility). - Deprecation Path: Marked
FlutterNotificationQueue,NotificationWidget.show(), and directNotificationWidgetinstantiation as@Deprecated. Seedoc/migration_v0_4.mdfor complete migration guidance.
Bug Fixes & Stability #
- Reorder & Relocate Null Safety: Resolved unexpected
nullvalue errors and unmounted state crashes during card reordering and relocation interactions. - Context-Aware Scope Resolution: Implemented a 3-tier coordinator lookup hierarchy (
explicit -> NotificationScope.maybeCoordinatorOf(context) -> FlutterNotificationQueue.coordinator) across UI overlay, queue widgets, and draggable transitions, preventing scopedNotificationControllerinstances from defaulting to global static singletons. - Blueprint Coordinator Preservation: Preserved
coordinatorreferences acrosscopyToQueue(relocation) andcopyForRequeue(snooze) blueprint copies. - Unmounted Timer Prevention: Prevented calling
initDismissTimer()on unmounting notification states after successful relocation.
Documentation & Tooling #
- Migration Guide: Added comprehensive migration documentation in
doc/migration_v0_4.md. - Studio Application: Refactored
example/Studio app to showcaseNotificationControllerandNotificationScopepatterns.
0.2.0 - 2026-07-19 #
Consolidated API & Subclass Removal #
- Simplified NotificationQueue: Removed all 8 specialized subclasses (
TopLeftQueue, etc.) in favor of a single, highly configurable concreteNotificationQueueclass with aconstconstructor. - QueuePosition Helpers: Simplified
generateQueue()onQueuePositionto directly buildNotificationQueueinstances, removing duplicate subclass-generation switch blocks.
Internal State Decoupling #
- Introduced NotificationEntry: Decoupled
NotificationWidgetconfiguration blueprint from active runtime state (dismiss timers, pinned lifecycle, resolved priority) by introducing the internalNotificationEntrywrapper class. - QueueCoordinator & Layout State: Refactored state-storage maps and animation list managers to use
NotificationEntry, preventing potentialGlobalKeyconflicts.
0.1.0 - 2026-07-10 #
Initial Public Preview Baseline #
All features from early pre-releases (0.4.0 - 0.7.0) consolidated into a single unified public baseline.
Interaction Engine (Physics & Reordering)
- Reorder Behavior: Users can pick up notifications and seamlessly rearrange them within their queue, empowering sophisticated inbox management.
- Overlap Mechanics: Replaced legacy gap-based targeting with a deeply physical "Overlap Target" model. The engine dynamically calculates the 2D bounding
Rectof every active notification on the fly to yield precise target indices. - Perfect Deadband Hysteresis: Implemented a "Gravity Well" (Target-Centric State) algorithm. The active drop zone applies a persistent 40-pixel magnetic lock to its own hit-test calculations, generating a flawless 80-pixel optical deadband that is 100% immune to pointer jitter, velocity spikes, and physical hand vibrations.
- Premium Bounding Reticles: Replaced the destructive horizontal center-line drop indicator with a Selection Reticle. Hovering over a card instantly frames its exterior in a glowing border while subtly darkening the interior (Recess Effect).
- Self-Target Suppression: The physics engine natively understands "cancel" drags. Hovering a payload over its own original starting slot visually suppresses all target feedback, rendering an empty placeholder hole so the user can comfortably drop the card back to safely abort.
- Smooth Height & Spring Snapbacks: Added dynamic height transitions when notifications expand or collapse, and physical spring snapback physics for aborted cancel drags.
- Visual Grab Cursors: Added grab and grabbing cursor states on draggable cards to improve desktop UX.
Layout, Grouping & Customization
- Notification Grouping & Bundling: Introduced dynamic stack configuration parameters (custom layer count, offsets, scales), recursive-safe swipe dismissals with reason propagation, and non-overlapping indicators with direction-aware tap-to-expand.
- Visual Boundaries: Added per-queue
maxWidthconstraints and layout collision delegate resolution. - Adaptive Close Button: Opacity-based model (
0.0–1.0) with subtle presence for touch devices (starts at0.3opacity for discoverability) and progressive enhancement (hidden until hover on desktop). - Hover-to-Pause Dismissal: Hovering over a notification card pauses its auto-dismiss timer, which resumes smoothly when the pointer leaves.
Core API & Observability
- Permanent Queue Relocation: Introduced runtime queue relocation via
Relocate.to(..., permanent: true)where dragging a card permanently redirects future queue traffic and migrates active cards together. - Event History Log: Added an in-memory, LIFO bounded ring buffer (
maxHistoryEntries) to capture notification events. AddedgetHistory()for querying with filters (channelName, dismissReason, since, limit) andclearHistory()for cache management. - Zero-overhead Disabling: When disabled (
maxHistoryEntriesis set to0or less), the history subscription is completely cancelled and detached, guaranteeing zero runtime performance or memory overhead. - Logd Core Integration: Upgraded logging package to
logdversion^0.8.6and integrated package-wide structured log handlers. - Stable Event Proxy: Replaced transient event streams with a persistent broadcast proxy stream to prevent zombie listeners across configure/reset cycles.
- Per-Notification Permanence: Added
permanent: trueflag to individualNotificationWidgets to bypass channel-level default dismiss durations.