-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Closed
flutter/packages
#3664Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.5Found to occur in 3.5Found to occur in 3.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
The log printed when debugLogDiagnostics
flag is set to true ignores every sub route declared inside a ShellRoute
.
Steps to Reproduce
Run the Code Sample with flutter run
Code sample
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: router,
);
}
}
final router = GoRouter(
debugLogDiagnostics: true,
routes: [
GoRoute(
path: '/',
builder: (context, state) => Center(
child: Text('home'),
),
routes: [
GoRoute(
path: 'inner-path-1',
builder: (context, state) => Text('Hello'),
),
ShellRoute(
builder: (context, state, child) => Center(
child: child,
),
routes: [
GoRoute(
path: 'shell-route-path-1',
builder: (context, state) => Text('Hello'),
),
GoRoute(
path: 'shell-route-path-2',
builder: (context, state) => Text('World'),
),
],
)
],
),
],
);
Logs
Actual log
[GoRouter] Full paths for routes:
=> /
=> /inner-path-1
[GoRouter] setting initial location null
[GoRouter] Using MaterialApp configuration
Expected log
[GoRouter] Full paths for routes:
=> /
=> /inner-path-1
=> /shell-route-path-1
=> /shell-route-path-2
[GoRouter] setting initial location null
[GoRouter] Using MaterialApp configuration
Expected results: ShellRoute
sub paths should be explored as well to print that log.
I found the problem is in the _debugFullPathsFor
function in lib/src/configuration.dart
which ignores ShellRoutes
not exploring them recursively.
pomaalvin, chris-hanna and koji-1009
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.5Found to occur in 3.5Found to occur in 3.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version