-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/packages
#2786Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has 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
when there are router parameters present, GoRouterState.params in ShellRoute.builder doesn't get filled, but it gets filled in the relative GoRoute
sample app:
class MyApp extends StatelessWidget {
const MyApp({super.key});
String logState(GoRouterState state) {
return 'Current route: ${state.location}, params: ${state.params}, queryParams: ${state.queryParams}';
}
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Flutter Demo',
routerConfig: GoRouter(
initialLocation: '/a',
routes: [
ShellRoute(
builder: (context, state, child) {
return Scaffold(
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('ShellRoute: ${logState(state)}'),
Expanded(child: child),
],
),
);
},
routes: [
GoRoute(
path: '/a',
builder: (context, state) => Text('a: ${logState(state)}'),
),
GoRoute(
path: '/b/:bParam',
builder: (context, state) => Text('b: ${logState(state)}'),
),
],
)
],
),
);
}
}Expected Result:
params in both should be the same
using go_router: ^5.0.2
Flutter (Channel master, 3.4.0-30.0.pre.18, on Microsoft Windows [Version 10.0.19043.2075], locale en-US)
• Flutter version 3.4.0-30.0.pre.18 on channel master at C:\tools\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9f5174f721 (28 hours ago), 2022-09-25 21:14:31 -0400
• Engine revision 1c232b584c
• Dart version 2.19.0 (build 2.19.0-240.0.dev)
• DevTools version 2.17.0
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has 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
