Auto Route click returns to home page when ad impression occurs

24 Views Asked by At

The build runner worked fine, clicks and transitions work, but I don't know if this is a bug or an error. It takes me to the home page when an ad is displayed or when I change the theme. Is there a solution to this, or is the package buggy? Even when I make the theme dark in the settings page, it redirects me to the home page for no reason.

@AutoRouterConfig(replaceInRouteName: 'View,Route')
class AppRouter extends $AppRouter {
  @override
  List<AutoRoute> get routes => [
        AutoRoute(
          path: '/dashboardView',
          page: DashboardRoute.page,
          initial: true,
          children: [
            AutoRoute(path: 'empty', page: EmptyRouter.page, children: [
              AutoRoute(
                path: 'a',
                page: A.page,
              ),
              AutoRoute(
                path: 'b',
                page: B.page,
              ),
              AutoRoute(
                path: 'c',
                page: C.page,
              ),
              AutoRoute(
                path: 'd',
                page: D.page,
              ),
              AutoRoute(
                path: 'e',
                page: E.page,
              ),
            ]),
          ],
        ),
        AutoRoute(
          path: '/f',
          page: F.page,
        ),
        AutoRoute(
          path: '/g',
          page: G.page,
        ),
      ];
}

@RoutePage(name: 'EmptyRouter')
class EmptyRouterPage extends AutoRouter {
  const EmptyRouterPage({super.key});
}

Dashboard:

@RoutePage()
class DashboardView extends StatelessWidget {
  const DashboardView({super.key});

  @override
  Widget build(BuildContext context) {
    return AutoTabsRouter(
      routes: const [
        ARoute(),
        BRoute(),
        CRoute(),
        DRoute(),
        ERoute(),
      ],
      builder: (context, child) {
        final tabsRouter = AutoTabsRouter.of(context);

        return Scaffold(
          body: child,
          bottomNavigationBar: SizedBox(
            height: 69.h,
            child: BottomNavigationBar(
              type: BottomNavigationBarType.fixed,
              showSelectedLabels: false,
              showUnselectedLabels: false,
              currentIndex: tabsRouter.activeIndex,
              onTap: (index) {
                int i = index;
                tabsRouter.setActiveIndex(index);
                print("route index : $i");
              },
              items: bottomNavItemList,
            ),
          ),
        );
      },
    );
  }
}
0

There are 0 best solutions below