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

homeIndex for AutoTabsRouter does not work #1617

Closed
mhbdev opened this issue Jun 20, 2023 · 4 comments
Closed

homeIndex for AutoTabsRouter does not work #1617

mhbdev opened this issue Jun 20, 2023 · 4 comments

Comments

@mhbdev
Copy link

mhbdev commented Jun 20, 2023

I have no idea why this parameter really exists! Changing it will not make any change.

@mhbdev
Copy link
Author

mhbdev commented Jun 21, 2023

I misunderstood homeIndex with activeIndex. so I close this issue.

@mhbdev mhbdev closed this as completed Jun 21, 2023
@Milad-Akarie
Copy link
Owner

@mhbdev Yup this is common, did you figure out how to set initial tab dynamically?

@mhbdev
Copy link
Author

mhbdev commented Jun 22, 2023

@mhbdev Yup this is common, did you figure out how to set initial tab dynamically?

Yes, I tried to setActiveIndex after the first build, but no I have no idea how to this dynamically.

@Milad-Akarie
Copy link
Owner

@mhbdev You need to think about tab routes as nested routes, how do you set an initial nested r route? you do it when navigating to the parent /parent/target child.
If your tab host page is the initial page you could do it like follows:

 routerConfig: _rootRouter.config(
  deepLinkBuilder: (deepLink){
    /// You don't want to override deep-links so
    /// check if the there's no deep link first
    if(deepLink.path == DeepLink.defaultPath){
      return DeepLink(TabHostRoute(children: [TargetTab()]));
    }
    return deepLink;
  }
),

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

2 participants