GoRouterState class Null safety

The route state during routing.

The state contains parsed artifacts of the current URI.

Annotations

Constructors

GoRouterState(RouteConfiguration _configuration, {required String location, required String subloc, required String? name, String? path, String? fullpath, Map<String, String> params = const <String, String>{}, Map<String, String> queryParams = const <String, String>{}, Map<String, List<String>> queryParametersAll = const <String, List<String>>{}, Object? extra, Exception? error, ValueKey<String>? pageKey})
Default constructor for creating route state during routing.

Properties

error Exception?
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.
read-only, override
location String
The full location of the route, e.g. /family/f2/person/p1
final
name String?
The optional name of the route.
final
pageKey ValueKey<String>
A unique string key for this sub-route, e.g. ValueKey('/family/:fid')
final
params Map<String, String>
The parameters for this sub-route, e.g. {'fid': 'f2'}
final
path String?
The path to this sub-route, e.g. family/:fid
final
queryParametersAll Map<String, List<String>>
The query parameters for the location, e.g. {'q1': ['v1'], 'q2': ['v2', 'v3']}
final
queryParams Map<String, String>
The query parameters for the location, e.g. {'from': '/family/f2'}
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
subloc String
The location of this sub-route, e.g. /family/f2
final

Methods

namedLocation(String name, {Map<String, String> params = const <String, String>{}, Map<String, String> queryParams = const <String, String>{}}) String
Get a location from route name and parameters. This is useful for redirecting to a named location.
@Deprecated('Uses GoRouter.of(context).routeInformationParser.namedLocation instead')
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.