GoRouterState class

The route state during routing.

The state contains parsed artifacts of the current URI.

Annotations

Constructors

GoRouterState(RouteConfiguration _configuration, {required Uri uri, required String matchedLocation, String? name, String? path, required String? fullPath, required Map<String, String> pathParameters, Object? extra, GoException? error, required ValueKey<String> pageKey, GoRoute? topRoute})
Default constructor for creating route state during routing.
const

Properties

error → GoException?
The error associated with this sub-route.
final
extra → Object?
An extra object to pass along with the navigation.
final
fullPath → String?
The full path to this sub-route, e.g. /family/:fid
final
hashCode → int
The hash code for this object.
no setteroverride
matchedLocation → String
The matched location until this point.
final
name → String?
The optional name of the route associated with this app.
final
pageKey → ValueKey<String>
A unique string key for this sub-route. E.g.
final
path → String?
The path of the route associated with this app. e.g. family/:fid
final
pathParameters → Map<String, String>
The parameters for this match, e.g. {'fid': 'f2'}
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
topRoute → GoRoute?
The current matched top route associated with this state.
final
uri → Uri
The full uri of the route, e.g. /family/f2/person/p1?filter=name#fragment
final

Methods

namedLocation(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, String> queryParameters = const <String, String>{}, String? fragment}) → String
Get a location from route name and parameters. This is useful for redirecting to a named location.
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.
override

Static Methods

of(BuildContext context) → GoRouterState
Gets the GoRouterState from context.