modularity_flutter 0.3.1
modularity_flutter: ^0.3.1 copied to clipboard
Flutter integration for Modularity framework. Provides widgets and utilities for module-based Flutter apps.
0.3.1 #
- Default keep-alive retention keys now include
Module.identityKey, preventing accidental controller reuse between same-type modules with different constructor identity. - Keep-alive route termination now disposes the evicted retained controller instead of only removing it from the retainer cache.
ModuleScopenow restarts its controller when lifecycle-critical widget configuration changes, including args, retention key, retention policy, and override scope changes.- Keep-alive scopes no longer recreate a controller during the route termination frame after the retained controller has already been evicted.
- Route-bound scopes now unsubscribe their route observer when disposed through an explicit restart.
ModuleRetainernow detaches route listeners when entries are evicted without disposing the underlying controller.ModularityRootnow disposes controllers that remain in the global registry when the root widget is disposed.ModuleRetainernow rejects disposed controllers, drops stale disposed entries on acquire, and validates negative reference counts.- Keep-alive route termination now awaits eviction and reports route cleanup
errors through
FlutterError. ModuleScopenow renders configuration failures through the normal error state instead of throwing during dependency changes.
0.3.0 #
Breaking Changes #
-
Removed
Modularitystatic singleton class. All state moved intoModularityRootwidget.Modularity.observer→ModularityRoot(observer: ...)+ModularityRoot.observerOf(context)Modularity.interceptors→ModularityRoot(interceptors: [...])+ModularityRoot.interceptorsOf(context)Modularity.enableDebugLogging()→ModularityRoot(lifecycleLogger: ModularityRoot.defaultDebugLogger)Modularity.lifecycleLogger→ModularityRoot(lifecycleLogger: ...)Modularity.log(...)→ModularityRoot.log(context, ...)Modularity.disableLogging()→ omitlifecycleLogger(null by default)
-
ModularityRootis now aStatefulWidget(wasInheritedWidget).- Immutable fields (
binderFactory,observer,retainer,interceptors) are locked ininitStateand cannot change. lifecycleLoggercan change (hot reload, toggle) without error.didUpdateWidgetreports errors viaFlutterError.reportErrorfor immutable field changes.
- Immutable fields (
-
ModuleRetentionBinding.observeris now a required field (was a getter readingModularity.observer). -
ModuleRetainerhas aloggerfield for lifecycle logging (set byModularityRoot).
New Features #
ModularityRoot.defaultDebugLogger-- static const logger for debug output.ModularityRoot.observerOf(context)-- typed accessor for the observer.ModularityRoot.interceptorsOf(context)-- typed accessor for interceptors.ModularityRoot.log(context, event, type, ...)-- log helper via inherited widget.- Debug warning when
observeris not provided (route-bound retention won't work).
Tests #
- Added unit tests for
ModularityRootwidget:didUpdateWidgetimmutable field protection,lifecycleLoggerhot-swap,disposecleanup, andinitStatedefaults.
Internal #
- Extracted
_build*methods fromModuleScopeinto separate widgets. - Resolved 11 bugs found by production readiness audit.
0.2.0 #
- Widgets and retention logic now throw typed exceptions from
modularity_contractsinstead of generic errors. - Added comprehensive dartdoc coverage on all public APIs.
- Added strict
analysis_options.yaml(strict-casts, strict-inference, strict-raw-types).
0.1.0 #
Retention Policies #
ModuleScopegainedretentionPolicy/retentionKey/retentionExtrassupport plus the newoverrideScopeparameter for child override trees.- Formal
ModuleRetentionPolicyenum:strict,routeBound,keepAlive. - Pluggable retention strategies with route-aware lifecycle management.
KeepAlivemodules now correctly dispose when owning route terminates.
Lifecycle Logging #
- Added
ModuleLifecycleEventenum andModuleLifecycleLoggercallback. - New
Modularity.enableDebugLogging()for console output in debug builds. - Events:
created,reused,registered,disposed,evicted,released,routeTerminated.
Documentation #
- Documented
retentionKeyvsoverrideScopecontract inModuleScopeandModuleRetainerdoc comments. - Updated README with lifecycle logging and retention contract examples.
0.0.2 #
- Updated dependencies to modularity_contracts ^0.0.2 and modularity_core ^0.0.2
- Improved package metadata for pub.dev (topics, issue_tracker)
0.0.1 #
- Initial release.