I want to implement GoRouter package for Routing in my existing Flutter mobile app(configuring for web). I have multiple modules with multiple screens which are currently handled by Navigator.push. How can I create nested GoRoutes for each of my module?
For example, My Registration flow is divided into 3 screens.
When I run the following code it shows no route for location error
// The route configuration.
final GoRouter _router = GoRouter(
routes: <RouteBase>[
GoRoute(
path: '/',
builder: (BuildContext context, GoRouterState state) {
return const MyHomePage();
},
routes: <RouteBase>[
GoRoute(
path: 'Registration_first',
builder: (BuildContext context, GoRouterState state) {
RegisterUserModel model = RegisterUserModel();
return RegistrationScreen(
onSuccess: (bool value) {
},
userData: model);
},
routes: <RouteBase>[
GoRoute(
path: 'Registration_second',
builder: (BuildContext context, GoRouterState state) {
return RegistrationNotificationScreen(
onComplete: (bool value) {
},
);
}),
GoRoute(
path: 'Registration_third',
builder: (BuildContext context, GoRouterState state) {
return RegistrationGenderScreen(
onComplete: (bool value) {
},
);
})
]),
],
),
],
);