Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cedvdb committed Sep 25, 2024
1 parent f678437 commit e468640
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/go_router/lib/src/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class RouteConfiguration {
routingTable.routes, <GlobalKey<NavigatorState>>[navigatorKey]));
assert(_debugCheckStatefulShellBranchDefaultLocations(routingTable.routes));
_routesByName.clear();
_cacheRouteByName(routingTable.routes);
_cacheRoutesByName(routingTable.routes);
log(debugKnownRoutes());
}

Expand Down Expand Up @@ -619,7 +619,7 @@ class RouteConfiguration {
}

/// adds an entry in the _routesByName map for every route and their descendants.
void _cacheRouteByName(List<RouteBase> routes) {
void _cacheRoutesByName(List<RouteBase> routes) {
for (final RouteBase route in routes) {
if (route is GoRoute) {
if (route.name != null) {
Expand All @@ -630,11 +630,11 @@ class RouteConfiguration {
}

if (route.routes.isNotEmpty) {
_cacheRouteByName(route.routes);
_cacheRoutesByName(route.routes);
}
} else if (route is ShellRouteBase) {
if (route.routes.isNotEmpty) {
_cacheRouteByName(route.routes);
_cacheRoutesByName(route.routes);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/go_router/lib/src/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class GoRoute extends RouteBase {
/// - [path] and [name] cannot be empty strings.
/// - One of either [builder] or [pageBuilder] must be provided.
GoRoute({
required this.path,
required String path,
this.name,
this.builder,
this.pageBuilder,
Expand Down Expand Up @@ -345,7 +345,7 @@ class GoRoute extends RouteBase {
///
/// See [Query parameters and path parameters](https://github.com/flutter/packages/blob/main/packages/go_router/example/lib/path_and_query_parameters.dart)
/// to learn more about parameters.
final String path;
String get path => pattern.toString();

/// A page builder for this route.
///
Expand Down

0 comments on commit e468640

Please sign in to comment.