Is there any ways to pass parameters(or extra Object) with sub routes?
When navigating PageA from PageB, type 'Null' is not a subtype of type 'int' error has occurred.
final _router = GoRouter(
debugLogDiagnostics: true,
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => TopPage(),
routes: [
GoRoute(
path: 'a',
builder: (context, state) {
final res = state.extra as Map<String, dynamic>;
return PageA(
num: res['num'],
);
},
routes: [
GoRoute(
path: 'b',
builder: (context, state) {
final res = state.extra as Map<String, dynamic>;
return PageB(
numFromA: res['numFromA'],
);
},
),
],
),
],
),
],
);
enum AppRouter {
pageA,
pageB;
}