pushed 0.4.0 copy "pushed: ^0.4.0" to clipboard
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 #

  • RouteScopeManager is now keyed by opaque RouteScopeHandles instead of entry scope names. createRouteScope returns a RouteScopeHandle; disposeRouteScope, hasScope, activeScopes (now List<RouteScopeHandle>), and currentScope (now RouteScopeHandle?) 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.
  • ScopeObserver maps route matches to RouteScopeHandles 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. hasActiveScope cross-checks the manager's ledger, so it now correctly returns false after RouteScopeManager.disposeAllScopes() (previously it kept reporting the torn-down scopes as active).
  • ScopeObserver.reset() now clears only live scope state: the recipe registry (via withScope) 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 #

  • ScopeObserver is no longer a NavigatorObserver; it attaches to a GoRouter (attach/detach) and creates and disposes scopes by diffing routerDelegate.currentConfiguration.matches by 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.
  • withScope is now an extension on RouteBase (covering GoRoute, ShellRoute, and StatefulShellRoute), replacing the old GoRoute/GoRouter extensions.
  • RouteScopeManager is now a per-router class with an injectable GetIt (was a global singleton). It keeps a ledger of the scope names it created and exposes activeScopes, currentScope, activeScopeCount, and hasScope; disposeRouteScope disposes by name via GetIt.dropScope.
  • ScopedRouteConfig is reduced to a recipe (scopeInitializer, scopeDisposer, isFinal); the routePath, scopeName, and effectiveScopeName fields were removed.
  • The teardown contracts changed semantics: RouteScopeManager.resetAllScopes is now a global GetIt.reset(dispose: false) that runs no disposers and wipes every scope in the shared GetIt (test teardown only); RouteScopeManager.disposeAllScopes disposes this manager's ledger by name, running disposers (logout/production teardown); ScopeObserver.reset is 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 into hasScope.

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.1 #

Added #

  • Example app demonstrating scoped dependencies with pushed package

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

0.1.0 #

Added #

  • Initial release of pushed package
  • RouteScopeManager for managing route-scoped dependencies
  • Core models (ScopedRouteConfig)
  • ScopeObserver for automatic scope lifecycle management
  • GoRoute extension for scope configuration
  • GoRouter extension for scope management helpers
1
likes
150
points
85
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Scoped dependencies for go_router routes using get_it. Manage route-specific dependencies with automatic lifecycle management.

Repository (GitHub)
View/report issues
Contributing

Topics

#go-router #dependency-injection #get-it #scoped-dependencies #flutter

License

MIT (license)

Dependencies

equatable, flutter, get_it, go_router, meta

More

Packages that depend on pushed