zenrouter
A powerful Flutter router with deep linking, web support, type-safe routing, guards, redirects, and zero boilerplate.
2.3.0
11K downloads/mo
#2800 most downloaded on pub.dev
definev/zenrouter
What this package is like to depend on
Last release 4 days ago
20 Aug 2026
Release timing varies
gaps range from 8 days to 3 months
Some releases are documented
notes for 14 of 42 stable releases
Nothing withdrawn
no release was ever pulled
8 months old
43 releases · first in 2025
43 releases in the last 12 months
see the full history below
Release timeline
43 releases · Dec 2025 to Aug 2026Releases
latest 43-
3.0.0-beta.120 Aug 2026 pre-releaseNothing published for this version
-
2.3.017 Aug 2026Release notes
Open source →⚠️ Breaking Changes
-
GuardRulecontract renamed (viazenrouter_core2.3.0). The 2.2.0 methods are removed:Removed Replacement canPop(route)canPopRule(route)/canPopRuleWith(coordinator, route)canPopListenable(route)canPopListenableRule(route)/canPopListenableRuleWith(coordinator, route)guard(coordinator, route)guardRule(route)/guardRuleWith(coordinator, route)Use route-only methods when no coordinator is needed; override
*Withfor dialogs / app state. Each*Withdefaults to its non-Withcounterpart.// Before class UnsavedChangesRule extends GuardRule<AppRoute> { @override bool canPop(AppRoute route) => !route.hasUnsavedChanges; @override FutureOr<bool?> guard(Coordinator c, AppRoute route) async => showDiscardDialog(c.navigator.context); } // After class UnsavedChangesRule extends GuardRule<AppRoute> { @override bool canPopRule(AppRoute route) => !route.hasUnsavedChanges; @override FutureOr<bool?> guardRuleWith(Coordinator c, AppRoute route) async => showDiscardDialog(c.navigator.context); }
🚀 New Features
RouteGuard.canPopWith/canPopListenableWith: Coordinator-aware PopScope hints;NavigationStackprefers these when a coordinator is present.RouteGuardRule.popGuard: Runs theguardRulechain without a coordinator.
📖 Documentation
- Recipe / example / mixins API updated for the dual
guardRule/guardRuleWithAPI.
-
-
2.2.021 Jul 2026Release notes
Open source →🚀 New Features
RouteGuardRule— composable pop guards- New
GuardRule/RouteGuardRuleAPI (viazenrouter_core2.1.0) for reusable leave-confirmation chains — first non-nullboolwins (null= continue). RouteGuard.canPop/canPopListenabledrive FlutterPopScope; programmaticpopstill always consultspopGuard/popGuardWith.- Flutter bridges:
toListenableMixin()/toFlutterListenable();NavigationStackrebuildsPopScopeviaListenableBuilderwhen a listenable is present.
⚠️ Breaking Changes
CoordinatorCore.pop: Pops only the nearest eligible path (no longer multi-path in one call). Bumpedzenrouter_coreto2.1.0.RouteRedirect.resolve: ThrowsStateErroron redirect type mismatch.
📖 Documentation
- New Recipe: Composable Route Guard Rules
- Example:
example/lib/main_guard_rules.dart - API: Mixins — guard rules section
- New
-
2.1.104 Jun 2026 -
2.1.023 May 2026Release notes
Open source →🚀 New Features
CoordinatorView— headless coordinator embed- New
CoordinatorViewwidget renders a coordinator vialayoutBuilderwithout Flutter'sRouter—for super apps, parallel panels, plugin surfaces, and other host-owned shells. - Optional
initialUriseeds navigation once whencoordinator.root.stackis empty (ignored after the embed has stack state or on remount with the same coordinator). - Supports sync and async
parseRouteFromUrifor the initial bootstrap.
CoordinatorLayoutBuildermixin- Extracted
layoutBuilder(BuildContext)intoCoordinatorLayoutBuilder;CoordinatorLayoutimplements it so embed hosts can depend on layout rendering withoutRouterConfig.
⚠️ Breaking Changes
layoutBuildermoved toCoordinatorLayout: OverridelayoutBuilderon your coordinator'sCoordinatorLayoutmixin (unchanged for typicalextends Coordinatorsubclasses). It is no longer declared on theCoordinatorclass body.RouteLayoutBuildersignature: The first parameter is nowCoordinatorCoreinstead ofCoordinator. Update customdefineLayoutBuilder/kDefaultLayoutBuilderTablecallbacks accordingly (cast toCoordinatorwhen you need Flutter-specific APIs).RouteLayout.buildRoot: Now acceptsCoordinatorLayoutinstead ofCoordinator. Call sites that passed a bareCoordinatorCoremust use a type that providesgetLayoutBuilder/root.
📖 Documentation
- New Guide: CoordinatorView — embed patterns,
initialUrisemantics, pitfalls vsMaterialApp.router - API: Coordinator API —
CoordinatorViewsection and dual quick-start - Roadmap: Embedded / multi-surface learning path in DOCUMENTATION_ROADMAP
- New
-
2.0.305 Mar 2026Release notes
Open source →- Fix:
CoordinatorModular.getModulenow correctly resolves the coordinator itself —runtimeType: thisis registered in_allModules, enablinggetModule<MyCoordinator>()to work at any level of the hierarchy. (Bumpedzenrouter_coreto 2.0.2)
- Fix:
-
2.0.202 Mar 2026Release notes
Open source →- Fix: Fix
CoordinatorModularedgecase cascading dispose and prevent duplicate definitions. (Bumpedzenrouter_coreto 2.0.1)
- Fix: Fix
-
2.0.127 Feb 2026Release notes
Open source →- Fix: Revert
hasEmptyPathback topathSegments.isEmptyinresolveInitialUrifor correct path empty checks. - Refactor: Remove redundant
initialRouteInformationparameter fromCoordinatorRouteInformationProvidersince fallback defaults and resolution logic is robust now.
- Fix: Revert
-
2.0.022 Feb 2026Release notes
Open source →🎉 Major Release - Core Architecture & Layouts
🚀 New Features
zenrouter_corePackage: Extracted all platform-independent core routing types (RouteTarget,CoordinatorCore,StackPath, and route mixins) into a new dedicated package.- Composable Redirects: You can use
RouteRedirectRuleasRouteRedirectto allow composable, testable redirect logic via multiple rules (e.g.,StopRedirect,ContinueRedirect,RedirectTo). - Route Identity updates: Introduced
RouteUriabstract class (andRouteUnique) to centralize URI-based identity for coordinator-managed routes.
⚠️ Breaking Changes
- Layout Binding Refactoring: The global
RouteLayout.defineLayouthas been removed. You must now bind layouts to paths using theStackPath.bindLayout()cascade syntax (e.g.,NavigationPath.createWith(...)..bindLayout(HomeLayout.new)), or usedefineLayoutParent()/defineLayoutBuilder()inside the coordinator. - Core Mixins Relocated: Core routing types have been consolidated under
zenrouter_core. The main package still exports them, but any explicit deep imports to old paths must be updated. - RouteLayout.definePath Deprecated: Deprecated
RouteLayout.definePathin favor ofcoordinator.defineLayoutBuilder.
📖 Documentation
- Architecture Overview: Completely redesigned READMEs to highlight the layered architecture and paradigm decisions.
- API Reference: Rewrote coordinator, mixins, and navigation paths API references from source.
-
1.2.011 Feb 2026Release notes
Open source →🐞 Fixes
- Fix: Regression error when using
RouteRedirectRuleinsideIndexedStackPath(Thanks to @obenkucuk)
🚀 New Features
Coordinator as RouteModule — Nested Coordinators
Coordinatornow implementsRouteModule<T>, enabling any coordinator to be nested inside aCoordinatorModularby overriding thecoordinatorgetter.- Unlocks route versioning (V1/V2 side by side), multi-team modular architectures, and deeply nested coordinator hierarchies.
- Auto-detected
isRouteModuleflag controls root path creation vs parent inheritance. - See Guide &
example/lib/main_coordinator_module.dart
⚠️ Breaking Changes
Coordinator.parseRouteFromUrisignature changed fromFutureOr<T>toFutureOr<T?>. Child coordinators returnnullfor unrecognized URIs; standalone coordinators are guarded by assertions.CoordinatorModular.parseRouteFromUrireturnsnullinstead ofnotFoundRoutewhen the coordinator is itself a nested module.
📖 Documentation
- New Guide: Coordinator as RouteModule
- New Recipe: Route Versioning
- Fix: Regression error when using
-
1.1.005 Feb 2026Release notes
Open source →- BREAKING CHANGE: Remove
coordinatorfromdefineModules, usethisgetter instead. - Feat: Enforce
getModulemethod return exact type.
- BREAKING CHANGE: Remove
-
1.0.028 Jan 2026Release notes
Open source →🎉 Major Release - Production Ready
🚀 New Features
CoordinatorModular - Modular Route Management
- Split route management across independent modules by domain/feature
CoordinatorModularmixin +RouteModulebase class- Perfect for large apps with team collaboration
- See Guide &
example/lib/main_modular.dart
class AppCoordinator extends Coordinator<AppRoute> with CoordinatorModular<AppRoute> { @override Set<RouteModule<AppRoute>> defineModules() => { AuthModule(this), ShopModule(this), }; }RouteRedirectRule - Composable Redirect Logic
- Reusable, chainable redirect rules (auth → feature flags → logging)
RedirectResultsealed class withStop/Continue/RedirectTovariants- Async support for API calls, database queries
class ProtectedRoute extends AppRoute with RouteRedirect, RouteRedirectRule { @override List<RedirectRule> get redirectRules => [ AuthenticationRule(), PermissionRule(permission: 'admin'), ]; }⚠️ Breaking Changes
Removed deprecated APIs:
RouteLayout.buildPrimitivePath→ UseRouteLayout.buildPathRouteLayout.layoutBuilderTable→ UseRouteLayout.buildPathRouteLayout.navigationPath/indexedStackPath→ UseNavigationPath.key/IndexedStackPath.keyrouterDelegateWithInitialRoute→ UseRouteRedirectinIndexRoute
See Migration Guide for details.
📦 What's Included
- ✅ Stable API surface
- ✅ Full test coverage (48 new tests: 33 modular + 15 redirect rule)
- ✅ Comprehensive documentation with guides
-
0.4.2024 Jan 2026 -
0.4.1910 Jan 2026Release notes
Open source →- Fix: Blank screen when using
CoordinatorasrouterConfig(due to unsetrouterInformationProvider). - Feat: Added
initialRoutePathproperty toCoordinator. - Feat: Added
NavigatorObserverListGettertypedef for passing external observers. (View Guide)
- Fix: Blank screen when using
-
0.4.1809 Jan 2026Release notes
Open source →- Feat: Add
pushReplacementmethod inStackMutatable. - Feat:
Coordinatornow implementsRouterConfigso you can use it withMaterialApp.routermore easily.-
MaterialApp.router( // New way routerConfig: coordinator, // Old way routerDelegate: coordinator.routerDelegate, routeInformationParser: coordinator.routeInformationParser, );
-
- Deprecate:
routerDelegateWithInitialRouteis deprecated, you can simulate the same behavior by usingRouteRedirectinIndexRoute.
0.4.17
- ZenRouter officially achieved 100% test coverage 🚀
- Docs: Added migration guides from other packages (go_router, auto_route, and Navigator 1.0/2.0)
- Docs: Added recipes for common use cases
- Docs: Added quick links section to make the docs easier to navigate
0.4.16
- Fix: Future already completed bug when pushing the same route with
pushOrMoveToTop.
0.4.15
- Feat: Add
onUpdatemethod toRouteTargetfor handling in-place route updates when navigating to the same route with different state. - Feat: Add
bindLayoutmethod toStackPathas a convenient alternative for layout registration. (See RouteLayout Guide)
0.4.14
- Breaking Change: Don't allow
redirectto return null anymore since it doesn't do anything. - Feat: Add
mustCallSupertopathsgetter (Thanks @mrgnhnt96) - Feat: Add
discardparameter toremovemethod for controlling discarding behavior. - Fix: Memory leak when pushing
RouteQueryParametersinIndexedStackPath. - Fix: Memory leak when discard route in
RouteRedirect.
0.4.13
- Fix: Ensure
navigatemethod is compatible withRouteRedirect.
0.4.12
- Feat: Introduce new
StackNavigatablemixin forStackPathto handle custom logic when receiving anavigatecommand. (Back/Forward button on the browser) - Fix:
navigateclear all history that occurred when pushing a custom layout.
0.4.11
- Feat: Expose
stackPathinRouteTargetand exposeprotectedmethod for developer create customstackPath. - Feat: Add
onDiscardto handle discarding phase inRouteTarget.
0.4.10
- Chore: Fix analyzer warnings
0.4.9
- Chore: Standardize
serializeanddeserializefor supportedRouteTargettype
0.4.8
- Feat: Introduce new state restoration with
RouteRestorationmixin. Support state restoration by default ifrestorationScopeIdis provided inMaterialApp.routerand usingCoordinatorpattern. - Fix: Resolve bug in
recovermethod whereRouteRedirectwas ignored.
0.4.7
- Docs: Update README
0.4.6
- Docs: Update README and add screenshots
0.4.5
- Feat: Add
RouteQueryParametersmixin for targeted query parameter updates usingValueNotifier. - Fix: Ensure
pathis set forRouteTargetwhen initialIndexedStackPath. - Fix: Ensure
layoutis resolve correct if they under deeper stack. - Refactor: Refactor folder structure and test folder structure to be more organized.
0.4.4
- Feat: New ZenRoute Logo!
- Docs: Improve document and update outdate example
0.4.3
- Feat: Add
CoordinatorNavigatorObservermixin to provide a list of observers for the coordinator's navigator. - Breaking Change: Complete redesign [RouteLayout] builder to be more flexible and powerful.
- Deprecate static method
RouteLayout.buildPrimitivePathand usebuildPathfunction instead. - Add ability to define new [StackPath] using
RouteLayout.definePath. You can create custom behavior path builder. (Eg: RecoverableHistoryStack like unrouter)
- Deprecate static method
0.4.2
- Feat: Add
transitionStrategytoCoordinatorfor default stack transition setup - Fix: Ensure when [Navigator.pop] called sync new stack with [NavigationPath]
0.4.1
- Fix: Ensure [Coordinator.routeDelegate] initialize once
- Improvement: Add [IndexedStackPathBuilder] for improve performance for rendering [IndexedStackPath]
0.4.0
- Breaking Change: Deprecated default constructors for
NavigationPathandIndexedStackPath. UseNavigationPath.create/createWithandIndexedStackPath.create/createWithinstead. - Breaking Change: Introduced
internalPropstoRouteTargetfor better deep equality and hash code generation. - Feat: Added
popGuardWithtoRouteGuardandredirectWithtoRouteRedirectfor coordinator-aware mixin logic. - Feat: Added strict path-coordinator binding support via
createWithfactories. - Docs: Added comprehensive Migration Guide.
- Feat: Added
routerDelegateWithInitalRoutetoCoordinator. - Feat: Enhanced
setInitialRoutePathto correctly handle initial routes vs deep links.
0.3.2
- Add
navigatefunction: A smarter alternative topushthat handles browser history restoration by popping to existing routes instead of duplicating them.
0.3.1
- Allow
parseRouteFromUrito returnFuturefor implementing deferred import/async route parsing
0.3.0
- Breaking change: Change return of
Coordinator.push()fromFuture<dynamic>toFuture<T?> - Fix
NavigationStackrerender page everytimepathupdated. Resolve #10. - Feat: Add
recoverfunction
0.2.3
- Update
activePathIndextoactiveIndexinIndexedStackPath - Update document for detailed, hand-written example of Coordinator pattern
0.2.2
- Expose pop result in Coordinator
- Fix memory leak: Complete route result futures when routes are removed via
pushOrMoveToTop - Fix memory leak: Complete intermediate route futures during
RouteRedirect.resolvechain
0.2.1
- Standardize how to access primitive path layout builder
- Define using
definePrimitivePath - Build using
buildPrimitivePath
- Define using
0.2.0
- BREAKING: Rename
activeHostPathstoactiveLayoutPathsto reflect correct concept.
0.1.2
- Update homepage link
0.1.1
- Fix broken document link by update it to github link
0.1.1
- Fix broken document link
0.1.0
- Initial release of ZenRouter.
- Unified Navigator 1.0 and 2.0 support.
- Coordinator pattern for centralized navigation logic.
- Support for both Declarative and Imperative navigation paradigms.
- Route mixins:
RouteGuard,RouteRedirect,RouteDeepLink. - Optimized Myers diff algorithm for efficient stack updates.
- Type-safe routing with
RouteUnique.
- Feat: Add
-
0.4.1706 Jan 2026Nothing published for this version
-
0.4.1602 Jan 2026Nothing published for this version
-
0.4.1502 Jan 2026Nothing published for this version
-
0.4.1402 Jan 2026Nothing published for this version
-
0.4.1330 Dec 2025Nothing published for this version
-
0.4.1230 Dec 2025Nothing published for this version
-
0.4.1129 Dec 2025Nothing published for this version
-
0.4.1028 Dec 2025Nothing published for this version
-
0.4.928 Dec 2025Nothing published for this version
-
0.4.826 Dec 2025Nothing published for this version
-
0.4.722 Dec 2025Nothing published for this version
-
0.4.622 Dec 2025Nothing published for this version
-
0.4.521 Dec 2025Nothing published for this version
-
0.4.420 Dec 2025Nothing published for this version
-
0.4.319 Dec 2025Nothing published for this version
-
0.4.216 Dec 2025Nothing published for this version
-
0.4.115 Dec 2025Nothing published for this version
-
0.4.015 Dec 2025Nothing published for this version
-
0.3.214 Dec 2025Nothing published for this version
-
0.3.113 Dec 2025Nothing published for this version
-
0.3.009 Dec 2025Nothing published for this version
-
0.2.307 Dec 2025Nothing published for this version
-
0.2.205 Dec 2025Nothing published for this version
-
0.2.104 Dec 2025Nothing published for this version
-
0.2.004 Dec 2025Nothing published for this version
-
0.1.204 Dec 2025Nothing published for this version
-
0.1.104 Dec 2025Nothing published for this version
-
0.1.004 Dec 2025Nothing published for this version