-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] complex example with auto_route #1630
Comments
AutoRoute(
path: '/dashboard',
page: DashboardRoute.page,
children: [
AutoRoute(path: '', page: UsersRoute.page),
AutoRoute(
path: 'profile',
page: ProfileRouter.page,
children: [
AutoRoute(
initial: true,
path: '',
page: SettingsRoute.page,
),
],
),
],
), How do you deal with this, where SettingsRoute is a child of ProfileRoute, but it is not nested and can only be accessed from profile on the UI |
Hey @davidnwaneri I think the problem here is the location of your ProfileRouter in the hierarchy, [
AutoRoute(
path: '/dashboard',
guards: [AuthGuard(_context)],
page: DashBoardRoute.page,
children: [
AutoRoute(
path: 'home',
page: HomeRoute.page,
),
AutoRoute(
page: ListRoute.page,
),
],
),
/// this should be in the root scope or any scope other than the tabsRouter scope
AutoRoute(
path: '/profile',
page: ProfileRouter.page,
children: [
AutoRoute(
initial: true,
path: '',
page: ProfileRoute.page,
),
],
),
] |
@Milad-Akarie Thank you for taking out time to respond. This worked. I had the wrong idea about declaring my routes. I've always thought dey should be declared the way they are accessed on the UI |
For more context - no pun intended - say I also had: AutoRoute(
path: '/profile',
page: ProfileRouter.page,
children: [
AutoRoute(
initial: true,
path: '',
page: ProfileRoute.page,
),
...
AutoRoute(
path: 'settings',
page: SettingsRoute.page,
),
],
), Settings route could have children route. Will this be valid or |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions |
Before v6 we had
EmptyRoutePage
But after v6 its been removed. The alternative as mentioned in the docs is
This is my route
There are only two items in the bottom nav bar,
HomeRoute
andListRoute
.ProfileRoute
is another screen entirely.But when i try to push
ProfileRoute
fromHomeRoute
, my home route just rebuilds.I use
context.pushRoute(const ProfileRouter());
to push theHomeRoute
. Please What am i doing wrong.The text was updated successfully, but these errors were encountered: