material library

Opt-in ready-made status views and a Material router setup helper.

Classes

AllowNavigation
Continue to the next check, or build the destination after the last check.
CurrentRoute
Information and cooperative cancellation for one navigation attempt.
DeniedPage
Optional view for a guard's deny decision.
DenyNavigation
Show the denied view without building the destination.
ErrorPage
Optional error view with pointer, keyboard and semantic retry actions.
JsonRouteArgumentsCodec
The default supports JSON values and rejects unsupported payloads eagerly.
LoadingPage
Optional loading view with a customizable, accessible message.
Opt-in router diagnostics. No logger runs unless configured on the router.
One immutable event. History is ordered oldest to newest by sequence.
NotFoundPage
Optional view for a location without a matching definition.
RedirectNavigation
Replace the attempted destination without running its remaining guards.
RouteArgumentsCodec
Converts application arguments to/from JSON-compatible history state.
RouteCancellation
Cooperative cancellation for work started by a guard.
RouteDecision
The terminal result of a navigation check.
RouteDefiner<T>
Immutable route definition. T is the value returned when its route is popped.
RouteDefinerParser
Parses full URIs and round-trips serialized navigation stacks.
RouteDefinerRouter
One instance-owned route table and Navigator stack.
RouteFactories
Native page presets that preserve typed results and Router page settings.
RouteFailure
A failed attempt; the library never automatically logs its arguments.
RouteLocation
A restorable location in a Router-managed stack.
RouteOptions
Configuration options for customizing native page behavior.
RoutePattern
A validated, reusable path pattern with whole-segment :parameters.
RouteSnapshot
A resolved, context-free snapshot of one router-managed page.
RouteStack
Canonical state reported to Flutter's Router and browser history.
RouteState
Immutable URI information for one navigation attempt.
RouteTableWarning
A definition that can never win declaration-order matching. Only complete coverage by one earlier pattern is reported; partial overlaps are intentional and are not warnings.

Enums

Observed managed-stack mutations or guard activity, not animation completion.

Functions

createMaterialRouter({required Iterable<RouteDefiner> routes, String initialRoute = '/', String appTitle = '', Widget loadingBuilder(CurrentRoute)?, Widget deniedBuilder(BuildContext, CurrentRoute)?, Widget notFoundBuilder(BuildContext, RouteState)?, Widget errorBuilder(BuildContext, RouteFailure, VoidCallback )?, void onError(RouteFailure)?, Duration? resolutionTimeout, int redirectLimit = 5, RouteOptions defaultRouteOptions = const RouteOptions(), DefinedRouteFactory? routeFactory, DefinedPageRouteFactory? pageRouteFactory, GlobalKey<NavigatorState>? navigatorKey, List<NavigatorObserver> observers = const [], String? restorationScopeId, RouteArgumentsCodec argumentsCodec = const JsonRouteArgumentsCodec(), Listenable? refreshListenable, BackButtonDispatcher? backButtonDispatcher, int historyLimit = 0, NavigationDiagnostics? diagnostics}) → RouteDefinerRouter
Creates a router with the optional status pages and Material page behavior. Keep the returned router outside build and dispose it with its owner. All explicit constructor options remain available, including view overrides.
parseRouteUri(String location) → Uri
Parses an absolute route path or external URI, rejecting invalid escapes.

Typedefs

DefinedPageRouteFactory = PageRoute<T> Function<T>(RouteSettings settings, WidgetBuilder builder, RouteOptions options)
Creates a page route, preserving the exact supplied settings object. Prefer this contract for new integrations; legacy factories remain supported.
DefinedRouteFactory = Route<T> Function<T>(RouteSettings settings, WidgetBuilder builder, RouteOptions options)
Creates the native route for a typed page. Preserve the supplied settings.
RouteGuard = FutureOr<RouteDecision> Function(CurrentRoute route)
A synchronous or asynchronous check before a route is displayed.

Exceptions / Errors

RouteCancelled
A cancelled navigation attempt.
RouteRedirectException
A redirect chain exceeded its limit or revisited a destination.