buildState method
GoRouterState
buildState(
- RouteConfiguration configuration,
- RouteMatchList matches, {
- required Map<
String, dynamic> metadata,
override
Gets the state that represent this route match.
Implementation
@override
GoRouterState buildState(
RouteConfiguration configuration,
RouteMatchList matches, {
required Map<String, dynamic> metadata,
}) {
// The route related data is stored in the leaf route match.
final RouteMatch leafMatch = _lastLeaf;
if (leafMatch is ImperativeRouteMatch) {
matches = leafMatch.matches;
}
return GoRouterState(
configuration,
uri: matches.uri,
matchedLocation: matchedLocation,
fullPath: matches.fullPath,
pathParameters: matches.pathParameters,
pageKey: pageKey,
extra: matches.extra,
topRoute: matches.lastOrNull?.route,
metadata: metadata,
);
}