auto_route_library
auto_route_library copied to clipboard
Can not resolve initial route with path params only
Thank you for the really cool package!
My routes are setup as below. They all work fine until I add a route with a path param like as shown.
When I add a path param, I can still navigate around the app, but if I go onto the /home/feedback path directly (eg. via a reload) without providing a path param, the app gives me a Can not resolve initial route
error.
I've tried explicitly providing the /home/feedback path in the routes setup like shown below but it doesn't help sadly.
@AutoRouterConfig()
class AppRouter extends RootStackRouter {
@override
List<AutoRoute> get routes => [
AutoRoute(path: "/loading", page: LoadingRoute.page, initial: true),
AutoRoute(page: WelcomeRoute.page, path: "/${constants.NAV_WELCOME}"),
AutoRoute(
page: HomeRoute.page,
path: "/${constants.NAV_HOME}",
children: [
AutoRoute(path: constants.NAV_DASHBOARD, page: DashboardRoute.page),
AutoRoute(path: '${constants.NAV_FEEDBACK}', page: FeedbackRoute.page), // tried with and without adding this explicitly
AutoRoute(path: '${constants.NAV_FEEDBACK}/:appname', page: FeedbackRoute.page),
AutoRoute(path: constants.NAV_SETTINGS, page: SettingsRoute.page),
],
),
];
}
Any advice would be much appreciated! Many thanks.