RouteConfiguration class

The route configuration for GoRouter configured by the app.

Constructors

RouteConfiguration(ValueListenable<RoutingConfig> _routingConfig, {required GlobalKey<NavigatorState> navigatorKey, Codec<Object?, Object?>? extraCodec, GoRouter? router})
Constructs a RouteConfiguration.

Properties

extraCodec → Codec<Object?, Object?>?
The codec used to encode and decode extra into a serializable format.
final
hashCode → int
The hash code for this object.
no setterinherited
The global key for top level navigator.
final
redirectLimit → int
The limit for the number of consecutive redirects.
no setter
router → GoRouter?
The GoRouter instance that owns this configuration.
final
routes → List<RouteBase>
The list of top level routes used by GoRouterDelegate.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
topOnEnter → OnEnter?
Top level page on enter.
no setter
topRedirect → GoRouterRedirect
Legacy top level page redirect.
no setter

Methods

applyTopLegacyRedirect(BuildContext context, RouteMatchList prevMatchList, {required List<RouteMatchList> redirectHistory}) → FutureOr<RouteMatchList>
Applies the legacy top-level redirect to prevMatchList and returns the resulting matches.
buildTopLevelGoRouterState(RouteMatchList matchList) → GoRouterState
Builds a GoRouterState suitable for top level callback such as GoRouter.redirect or GoRouter.onException.
debugKnownRoutes() → String
Returns the full path of routes.
findMatch(Uri uri, {Object? extra}) → RouteMatchList
Finds the routes that matched the given URL.
locationForRoute(RouteBase route) → String?
Get the location for the provided route.
namedLocation(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, String? fragment}) → String
Looks up the url location by a GoRoute's name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redirect(BuildContext context, FutureOr<RouteMatchList> prevMatchListFuture, {required List<RouteMatchList> redirectHistory}) → FutureOr<RouteMatchList>
Processes all redirects (top-level and route-level) and returns the final RouteMatchList.
reparse(RouteMatchList matchList) → RouteMatchList
Reparse the input RouteMatchList
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

normalizeUri(Uri uri) → Uri
Normalizes a URI by ensuring it has a valid path and removing trailing slashes.