zenrouter_core 2.3.0
zenrouter_core: ^2.3.0 copied to clipboard
The core routing engine and unified interfaces for the ZenRouter navigation system. Contains common models, types, and logic used across the zenrouter ecosystem.
2.3.0 #
Breaking Changes #
-
GuardRulecontract renamed for coordinator-optional use. The 2.1.0 methods are removed:Removed (2.2.0) Replacement canPop(route)canPopRule(route)/canPopRuleWith(coordinator, route)canPopListenable(route)canPopListenableRule(route)/canPopListenableRuleWith(coordinator, route)guard(coordinator, route)guardRule(route)/guardRuleWith(coordinator, route)Migration:
// Before (2.2.0) class UnsavedChangesRule extends GuardRule<AppRoute> { @override bool canPop(AppRoute route) => !route.hasUnsavedChanges; @override FutureOr<bool?> guard(CoordinatorCore c, AppRoute route) async { /* ... */ } } // After (2.3.0) — route-only class UnsavedChangesRule extends GuardRule<AppRoute> { @override bool canPopRule(AppRoute route) => !route.hasUnsavedChanges; @override FutureOr<bool?> guardRule(AppRoute route) async { /* ... */ } } // After (2.3.0) — needs coordinator (dialogs, app state) class UnsavedChangesRule extends GuardRule<AppRoute> { @override bool canPopRule(AppRoute route) => !route.hasUnsavedChanges; @override FutureOr<bool?> guardRuleWith(CoordinatorCore c, AppRoute route) async { /* ... */ } }Each
*Withmethod defaults to its non-Withcounterpart.guardRuledefaults tonull(continue chain).
New Features #
RouteGuard.canPopWith/canPopListenableWith: Coordinator-aware PopScope hints (default tocanPop/canPopListenable).RouteGuardRule.popGuard: Now runs theguardRulechain (no coordinator), matchingpopGuardWith→guardRuleWith.
2.2.0 #
New Features #
GuardRule/RouteGuardRule: Composable pop-guard chains (first non-nullboolwins), mirroringRedirectRule/RouteRedirectRule.RouteGuard.canPop/canPopListenable: Sync PopScope hint plus optionalListenableMixininvalidation when leave-safety changes.ListenableMixin: Subscribe-only reactive surface (withListenableMixin.merge);ListenableObjectnow implements it.
Breaking Changes #
CoordinatorCore.pop: Pops only the nearest eligible stack path. Nested shells are no longer popped together with child stacks in a single call.RouteRedirect.resolve: ThrowsStateErrorwhen a redirect returns a different route type (previously silently ignored).
2.0.3 #
- chore: make
RedirectRulecan be const
2.0.2 #
- Fix
CoordinatorModular.getModulenow correctly resolves the coordinator itself by registeringruntimeType: thisin_allModules, enablinggetModule<MyCoordinator>()to work at any level of the hierarchy.
2.0.1 #
- Fix
CoordinatorModularedge case cascading dispose and prevent duplicate definitions.
2.0.0 #
- Extract core function from
zenrouterpackage