auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

Initial page created when homeIndex is set differently

Open pro100svitlo opened this issue 8 months ago • 0 comments

Initial setup:

  • I have a list of 3 children in the router

Expected behavior:

  • when I load main screen for the first time and specify home index in AutoTabsRouter as 1
    • only page 1 is loadede

Current/wrong behavior:

  • when I load main screen for the first time and specify home index in AutoTabsRouter as 1
    • page 0 is loaded first
    • immediately after it page 1 is loaded

Below you can find my code:

router:

      AutoRoute(
        page: MainScreenRoute.page,
        initial: true,
        children: [
          AutoRoute(page: MyTasksPageRoute.page),
          AutoRoute(page: MainPageSearchTaskRoute.page),
          AutoRoute(page: MyProfilePageRoute.page),
        ],
      ),

main class:

    return AutoTabsScaffold(
      routes: const [
        MyTasksPageRoute(),
        MainPageSearchTaskRoute(),
        MyProfilePageRoute(),
      ],
      homeIndex: state.currentPage.index,
      bottomNavigationBuilder: (_, TabsRouter router) {

pro100svitlo avatar Dec 26 '23 07:12 pro100svitlo