zenrouter library
Classes
-
ActiveRouteRestorable<
T extends RouteUnique> - A RestorableValue that manages the restoration of the currently active route in the navigation stack.
-
BranchedStackPath<
T extends RouteTarget> - A fixed collection of layout branches with an independent child path per branch.
-
ContinueRedirect<
T extends RouteTarget> - Result indicating the next rule should be processed.
-
Coordinator<
T extends RouteUnique> - The Flutter-specific implementation of navigation coordinator.
-
CoordinatorCore<
T extends RouteUri> - The central hub for navigation state in ZenRouter.
- CoordinatorRestorable
- A widget that enables state restoration for a Coordinator and its navigation hierarchy.
- CoordinatorRouteInformationProvider
- A RouteInformationProvider that derives its initial route from both the platform and a Coordinator.
- CoordinatorRouteParser
- Parses RouteInformation to and from Uri.
- CoordinatorRouterDelegate
- Router delegate that connects the Coordinator to Flutter's Router.
-
CoordinatorView<
T extends RouteUri> -
Headless coordinator host: builds
coordinator.layoutBuilderwithout a root Router. -
CupertinoSheetPage<
T extends Object> - A page that presents its route as a Cupertino-style bottom sheet.
- A widget that manages a navigation stack declaratively.
-
Delete<
T> - Represents deleting an element at a specific index.
-
DialogPage<
T> - A page that presents its route as a dialog overlay.
-
DiffOp<
T> - Represents a diff operation between two lists.
-
ErrorRouteResolution<
T extends RouteUri> - A typed routing failure suitable for an error page or HTTP 5xx response.
- FlutterListenableMixin
-
Adapts a Flutter foundation flutter.Listenable (
ValueNotifier,ChangeNotifier, etc.) to ListenableMixin for RouteGuard.canPopListenable. -
GuardRule<
T extends RouteTarget> - Base class for composable pop-guard logic.
-
IndexedStackPath<
T extends RouteTarget> - A fixed stack path for indexed navigation (like tabs).
-
IndexedStackPathBuilder<
T extends RouteUnique> - Widget that builds an IndexedStack from an IndexedStackPath. Ensures that the stack caches pages when rebuilding the widget tree.
-
Insert<
T> - Represents inserting a new element at a specific index.
-
Keep<
T> - Represents keeping an element at a specific index (no change).
- ListenableMixin
- Subscribe-only surface for reactive updates.
- ListenableMixinToFlutter
- Adapts a ListenableMixin to Flutter's flutter.Listenable for use with ListenableBuilder / AnimatedBuilder.
-
MatchedRouteResolution<
T extends RouteUri> - A successfully matched route.
-
Mutatable<
T> - Shared stack-mutation contract for coordinators and stack paths.
- Shared navigation contract for coordinators and stack paths.
- Immutable snapshot published after a coordinator transaction commits.
- A mutable stack path for standard navigation.
- A RestorableValue that manages the restoration of navigation route stacks.
- A widget that renders a stack of pages based on a NavigationPath.
-
NotFoundRouteResolution<
T extends RouteUri> - A not-found outcome. route may render a framework-specific 404 page.
-
NoTransitionPage<
T> -
RedirectResult<
T extends RouteTarget> - Result of a redirect rule, determining the next action in the chain.
-
RedirectRouteResolution<
T extends RouteUri> - A redirect outcome that an HTTP or browser adapter can apply correctly.
-
RedirectRule<
T extends RouteTarget> - Base class for composable redirect logic.
-
RedirectTo<
T extends RouteTarget> - Result indicating navigation to a different route.
-
RestorableConverter<
T extends Object> - An abstract base class for implementing custom serialization logic for routes.
-
RouteBinding<
I extends Object, T extends RouteUri> - Presentation adapter for one route-manifest ID.
-
RouteBindingRegistry<
I extends Object, T extends RouteUri> - Immutable, validated adapter from a RouteManifest to concrete routes.
- RouteCancellationToken
- Cooperative cancellation token for route resolution and loaders.
- RouteHydrationPayload
- Versioned, immutable payload transferred from route resolution to hydration.
-
RouteIdCodec<
I extends Object> - Converts typed in-memory route IDs to and from their stable wire names.
-
RouteManifest<
I extends Object> - Immutable declarative graph of every route and layout known to a router.
-
RouteManifestBranchedKind<
I extends Object> - Fixed ordered branch layout roots of a branched layout.
-
RouteManifestFragment<
I extends Object> - An immutable contribution to a larger RouteManifest.
-
RouteManifestIndexedKind<
I extends Object> - Fixed ordered children of an indexed layout.
-
RouteManifestLayout<
I extends Object> - Static topology for one layout destination.
-
RouteManifestLayoutKind<
I extends Object> - The child-structure contract of a layout declared in a RouteManifest.
-
RouteManifestMatch<
I extends Object> - Result of matching a URI against a RouteManifest.
-
RouteManifestNode<
I extends Object> -
RouteManifestRoute<
I extends Object> - Static topology for one routable destination.
-
RouteManifestStackKind<
I extends Object> -
Unbounded stack topology. Children are discovered only through
parentId. -
RouteModule<
T extends RouteUri> - Base class for route modules that handle a subset of application routes.
- RoutePattern
- A parsed, validated URI path pattern.
- RoutePatternSegment
- One immutable segment in a RoutePattern.
- RouteRequest
- Request-scoped input shared by navigation and server rendering adapters.
-
RouteResolution<
T extends RouteUri> - Typed outcome produced before any rendering adapter runs.
-
RouteResolver<
T extends RouteUri> - Seam implemented by routing kernels and consumed by rendering adapters.
- RouteTarget
- The base class for all navigation destinations in the application.
- RouteUri
- Abstract base class for routes with URI representation.
-
StackPath<
T extends RouteTarget> - A container managing a stack of RouteTargets for navigation.
-
StackTransition<
T extends RouteTarget> - Defines how a route should be displayed as a widget and wrapped in a page.
-
StopRedirect<
T extends RouteTarget> - Result indicating navigation should be cancelled.
Enums
- DeeplinkStrategy
- Strategy that determines how CoordinatorCore handles deep links.
- DefaultTransitionStrategy
- Strategy for controlling page transition animations in the navigator.
- How the next committed navigation should affect an external history.
- RestorationStrategy
- Defines the strategy used to serialize and deserialize a route for state restoration.
- RoutePatternSegmentKind
- The kind of a segment in a declarative route pattern.
Mixins
-
CoordinatorLayout<
T extends RouteUnique> - Mixin that provides Flutter layout builders for Coordinator.
-
CoordinatorLayoutBuilder<
T extends RouteUri> -
CoordinatorLayoutCore<
T extends RouteUri> - Mixin that owns layout-parent registration and hierarchy activation.
-
CoordinatorModular<
T extends RouteUri> - Mixin that enables modular route management by delegating to multiple modules.
-
CoordinatorMutatable<
T extends RouteUri> - Mixin for coordinators that support push/pop/replace stack mutations.
- Mixin for coordinators that support smart history navigation.
- Mixin that provides a list of observers for the coordinator's navigator.
-
CoordinatorRecoverable<
T extends RouteUri> - Mixin for coordinators that recover navigation state from deep links.
-
CoordinatorRestoration<
T extends RouteUnique> - Mixins for coordinating route state restoration.
-
CoordinatorTransitionStrategy<
T extends RouteUnique> - ListenableObject
- Mixin that provides listener management for observable objects.
-
RestorablePath<
T extends RouteTarget, S, D> - A mixin that adds state restoration capabilities to navigation paths.
- RouteDeepLink
- Mixin for routes that specify deep link handling behavior.
- RouteGuard
- Mixin for routes that can intercept and block pop operations.
-
RouteGuardRule<
T extends RouteTarget> - Mixin for routes that use a list of guard rules.
-
RouteIdentity<
T> - Mixin that provides route identification capability.
-
RouteLayout<
T extends RouteUnique> - Mixin for routes that define a layout structure.
- RouteLayoutChild
- Mixin for routes that belong to a parent layout.
-
RouteLayoutParent<
T extends RouteTarget> - Mixin for routes that act as layout parents (shell routes).
-
RouteModuleBinding<
T extends RouteUri, I extends Object> - Manifest-backed URI parsing through routeBindings.
- RouteNotFound
- Marker for a route that renders a not-found result while preserving the originally requested URI.
- RouteQueryParameters
- Mixin for routes that support query parameters.
-
RouteRedirect<
T extends RouteTarget> - Mixin that allows routes to redirect to different destinations.
-
RouteRedirectRule<
T extends RouteTarget> - Mixin for routes that use a list of redirect rules.
-
RouteRestorable<
T extends RouteTarget> - A mixin that enables custom state restoration for routes that cannot be fully represented by a URI.
- RouteTransition
- Mixin that enables custom page transitions for routes.
- RouteUnique
- Base mixin for unique routes in the application.
-
StackMutatable<
T extends RouteTarget> - Mixin for stack paths that support mutable navigation operations.
- Mixin for stack paths that support browser history navigation.
Extensions
-
CoordinatorUriActions
on CoordinatorRecoverable<
T> - Location-based convenience operations for a fully capable coordinator.
- ListenableMixinToFlutterListenable on ListenableMixin
- Converts a ListenableMixin to Flutter's flutter.Listenable.
- ListenableToListenableMixin on Listenable
- Converts a Flutter flutter.Listenable to ListenableMixin.
-
RouteLayoutBinding
on StackPath<
T> - Extension that binds a RouteLayout constructor to a StackPath.
-
RouteManifestBinding
on RouteManifest<
I> - Builds a typed route-binding registry directly from this manifest.
- UriCoordinatorActions on Uri
- Destination navigation for a Uri against a fully capable coordinator.
Properties
-
kDefaultLayoutBuilderTable
→ Map<
PathKey, RouteLayoutBuilder< RouteUnique> > -
Built-in layout builders for NavigationPath, IndexedStackPath, and
BranchedStackPath.
final
Functions
-
applyDiff<
T extends RouteTarget> (StackMutatable< T> path, List<DiffOp< operations) → voidT> > - Apply diff operations to a NavigationPath.
-
deferredBindingFactory<
A, R> ({required RouteLibraryLoader loadLibrary, required FutureOr< R> create(A)}) → Future<R> Function(A) -
Wraps
createsoloadLibrarycompletes first. -
deferredRouteNotFoundBinding<
T extends RouteUri> ({required RouteLibraryLoader loadLibrary, required RouteNotFoundBinding< T> create}) → RouteNotFoundBinding<T> - Deferred RouteNotFoundBinding using deferredBindingFactory.
-
myersDiff<
T> (List< T> oldList, List<T> newList, {bool equals(T a, T b)?}) → List<DiffOp< T> > - Myers diff algorithm implementation.
-
requireFlutterCoordinator(
CoordinatorCore< RouteUri> coordinatorCore, {required PathKey pathKey}) → Coordinator<RouteUnique> -
Ensures
coordinatorCoreis a Flutter Coordinator for default path builders.
Typedefs
-
CoordinatorDeeplinkHandler<
T extends RouteUri> = FutureOr< void> Function(CoordinatorRecoverable<T> coordinator, T route) - Handler invoked when recovering a deep link with a given DeeplinkStrategy.
- DecodeLayoutKeyCallback = Object Function(String key)
-
PageCallback<
T> = Page< void> Function(BuildContext context, LocalKey routeKey, Widget child) - Callback that builds a Page from a route and child widget.
-
QuerySelectorBuilder<
T> = Widget Function({required Widget builder(BuildContext context, T value), required T selector(Map< String, String> queries)}) - Widget builder for query parameters.
-
RestorableConverterLookupFunction
= RestorableConverter<
Object> ? Function(String key) - A function that looks up a RestorableConverter by its key.
-
RestoratableConverterConstructor<
T extends Object> = RestorableConverter< T> Function() - Constructor function for creating a restorable value converter.
-
RouteBindingFactory<
T extends RouteUri> = FutureOr< T> Function(RouteManifestMatch<Object> match) - Creates one concrete route from a successful manifest match.
-
RouteLayoutBuilder<
T extends RouteUnique> = Widget Function(CoordinatorCore< RouteUri> coordinator, StackPath<T> path, RouteLayout<T> ? layout) - Builder function for creating a layout widget that wraps route content.
-
RouteLayoutConstructor<
T extends RouteUnique> = RouteLayout< T> Function() - Constructor function for creating a layout instance.
-
RouteLayoutParentConstructor<
T extends RouteTarget> = RouteLayoutParent< T> ? Function(Object key) - Function signature for creating RouteLayoutParent instances.
- RouteLibraryLoader = Future Function()
- Loads a deferred library before a binding factory runs.
-
RouteNotFoundBinding<
T extends RouteUri> = FutureOr< T?> Function(Uri uri) - Creates an optional route when no manifest pattern matches a URI.
-
RouteUriParserSync<
T extends RouteTarget> = T Function(Uri uri) - Synchronous parser function that converts a Uri into a route instance.
-
StackTransitionResolver<
T extends RouteTarget> = StackTransition< T> Function(T route) - Callback that maps routes to their StackTransition.
Exceptions / Errors
-
RouteBindingValidationException<
I extends Object> - Invalid or incomplete manifest-to-route binding configuration.
-
RouteManifestValidationException<
I extends Object> - RouteResolutionCancelled
- Control-flow exception used to stop a superseded route resolution.
- UnsupportedHydrationVersion
- Raised when a payload uses a schema version this runtime cannot decode.
- UnsupportedRouteManifestVersion