Skip to content
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

Nested Routes With Parameters on IndexedPage #310

Open
nnadir35 opened this issue Oct 27, 2022 · 0 comments
Open

Nested Routes With Parameters on IndexedPage #310

nnadir35 opened this issue Oct 27, 2022 · 0 comments

Comments

@nnadir35
Copy link

Hi i want use nested routes with parameters on IndexedPage.

routes: {
    /main: (routedata) =>
            const IndexedPage(
                child: MainView(),
                backBehavior: TabBackBehavior.history,
                paths: [
                  profileViewRoute,
                  shopViewRoute,
                  favoriteViewRoute,
                ],
              )
    /main/profile: (_) => const MaterialPage(child: ProfileView()),
    /main/menu (route) => IndexedPage(child: MenuView(), paths: [/main/category,/main/products]),
    /main/category: (_) => const MaterialPage(child: CategoryListView()),
    /main/products: (route) => MaterialPage(child: CategoryListView(selectedCategoryIndex:  route.pathParameters['id'])),
    favoriteViewRoute: (_) => const MaterialPage(child: FavoriteView()), 
  },

I use path parameters and works fine.But my main goal is want to create nested pages on menuView. But i want also pass the category id to productlistview page. Because i should show the category id on the product page. But i cant pass the route variable to main/products which is in the paths array.

Example Url: main/menu/products/3

Example Routing:

main/profile ->
main/menu (im on categorylistviewroute)
push to productlistview -->
main/menu/products/3

Could you help me please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant