pushed 0.4.0
pushed: ^0.4.0 copied to clipboard
Scoped dependencies for go_router routes using get_it. Manage route-specific dependencies with automatic lifecycle management.
Changelog #
0.4.0 #
Changed #
RouteScopeManageris now keyed by opaqueRouteScopeHandles instead of entry scope names.createRouteScopereturns aRouteScopeHandle;disposeRouteScope,hasScope,activeScopes(nowList<RouteScopeHandle>), andcurrentScope(nowRouteScopeHandle?) take or return handles. The handle wraps the runtime-unique entry scope name, and the manager's ledger is now the single source of truth for which scopes are alive.ScopeObservermaps route matches toRouteScopeHandles and delegates all liveness queries to the manager. Its stale-disposal guard is gone: mappings are removed synchronously when an entry leaves the stack, so the observer's bookkeeping matches the ledger even while disposal runs.hasActiveScopecross-checks the manager's ledger, so it now correctly returns false afterRouteScopeManager.disposeAllScopes()(previously it kept reporting the torn-down scopes as active).ScopeObserver.reset()now clears only live scope state: the recipe registry (viawithScope) survives, so the observer remains usable and recreates scopes on the next navigation instead of being a one-shot teardown.
Added #
ScopeObserver.disposeAllScopes(): the logout/production teardown that runs each scope's disposer per the manager's ledger and keeps the observer's bookkeeping consistent.
0.3.0 #
Changed #
ScopeObserveris no longer aNavigatorObserver; it attaches to aGoRouter(attach/detach) and creates and disposes scopes by diffingrouterDelegate.currentConfiguration.matchesby match identity (navigation diff). Each route entry gets its own get_it scope under a runtime-unique entry scope name, so pushing the same route twice yields independent scopes.withScopeis now an extension onRouteBase(coveringGoRoute,ShellRoute, andStatefulShellRoute), replacing the oldGoRoute/GoRouterextensions.RouteScopeManageris now a per-router class with an injectableGetIt(was a global singleton). It keeps a ledger of the scope names it created and exposesactiveScopes,currentScope,activeScopeCount, andhasScope;disposeRouteScopedisposes by name viaGetIt.dropScope.ScopedRouteConfigis reduced to a recipe (scopeInitializer,scopeDisposer,isFinal); theroutePath,scopeName, andeffectiveScopeNamefields were removed.- The teardown contracts changed semantics:
RouteScopeManager.resetAllScopesis now a globalGetIt.reset(dispose: false)that runs no disposers and wipes every scope in the shared GetIt (test teardown only);RouteScopeManager.disposeAllScopesdisposes this manager's ledger by name, running disposers (logout/production teardown);ScopeObserver.resetis a one-shot reset that also clears the observer's registry.
Added #
- Scoping support for
StatefulShellRoute: the scope attaches to the shell route as a whole, so branch switches do not dispose it; per-branch scoping is not supported.
Removed #
RouteScopeManager.getScope, folded intohasScope.
0.2.2 #
Changed #
- Reorganized pubspec.yaml with repository, homepage, and issue_tracker fields
- Updated README with better formatting and support section
Added #
- Topics metadata in pubspec.yaml for better discoverability
- GitHub workflows for testing and publishing
Fixed #
- Updated footer in README with proper attribution
0.2.0 #
Changed #
- Updated get_it from ^7.6.0 to ^9.2.1
- Updated go_router from ^14.0.0 to ^17.1.0
- Updated equatable from ^2.0.0 to ^2.0.8
- Updated very_good_analysis from ^6.0.0 to ^10.2.0
- Enhanced SDK constraints for better stability and compatibility
Added #
- Complete export of public API in main library file (ScopeObserver, extensions)
- Improved type safety and documentation
- Support for latest go_router features and improvements
- Enhanced compatibility with latest get_it service locator features
- MIT License content
Fixed #
- Fixed missing exports for ScopeObserver and GoRoute/GoRouter extensions