RouteDefiner<T> class
Immutable route definition. T is the value returned when its route is popped.
Constructors
-
RouteDefiner({required String path, required Widget builder(BuildContext, RouteState), List<
RouteGuard> guards = const [], Map<String, Object> ? data, FutureOr<String> title(RouteState)?, RouteOptions? options, DefinedRouteFactory? routeFactory, DefinedPageRouteFactory? pageRouteFactory}) -
RouteDefiner.redirect({required String path, required FutureOr<
String> redirect(RouteState), List<RouteGuard> guards = const [], Map<String, Object> ? data}) - Runs preceding guards, then redirects through the normal guard pipeline. Redirect destinations are locations, with the usual cancellation, timeout, retry and loop limits. Arguments are not forwarded to the destination.
-
RouteDefiner.simple({required String path, required WidgetBuilder builder, List<
RouteGuard> guards = const [], Map<String, Object> ? data, FutureOr<String> title(RouteState)?, RouteOptions? options, DefinedRouteFactory? routeFactory, DefinedPageRouteFactory? pageRouteFactory}) - Defines a screen that does not need URI state in its builder.
Properties
- builder → Widget Function(BuildContext, RouteState)
-
final
-
data
→ Map<
String, Object> ? -
final
-
guards
→ List<
RouteGuard> -
Run in order before the page is built. Return allow, deny or redirect.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- options → RouteOptions?
-
final
- pageRouteFactory → DefinedPageRouteFactory?
-
Page-specific alternative to routeFactory. Preserves page identity.
final
- path → String
-
final
- pattern → RoutePattern
-
Validated pattern compiled once per definition.
final
- routeFactory → DefinedRouteFactory?
-
Overrides the router factory for this page.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
title
→ FutureOr<
String> Function(RouteState)? -
Resolves this page's title from its URI state when title publishing is enabled.
final
Methods
-
location(
{Map< String, String> parameters = const {}, Map<String, dynamic> ? queryParameters, String? fragment}) → Uri - Builds a location with encoded path, query and fragment values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited