Milad-Akarie / auto_route_library

Flutter route generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with screen going blank after navigating back from nested routes with wrappers in version 8.0.0

soultome opened this issue · comments

After updating to version 8.0.0 , I encountered an issue where the screen goes blank after navigating back from a route that acts as a wrapper and contains nested routes with children that also have children. This issue is specific to routes with this nested structure and was not present in version 7.9.2 and earlier versions, where navigation worked as expected.

@AutoRouterConfig()
class AppRouter extends _$AppRouter {
  @override
  List<AutoRoute> get routes => [
        AutoRoute(
          initial: true,
          page: HomeRoute.page,
        ),
        AutoRoute(
          path: "/detail",
          page: DetailWrapperRoute.page,
          children: [
            AutoRoute(
              initial: true,
              page: DetailRoute.page,
              children: [
                AutoRoute(
                  page: FirstTabRoute.page,
                ),
                AutoRoute(
                  page: SecondTabRoute.page,
                )
              ],
            ),
            AutoRoute(
              path: "insideDetail",
              page: InsideDetailRoute.page,
            )
          ],
        )
      ];
}

To reproduce the issue:

  1. Navigate from the parent route (HomeRoute) to the wrapper route (DetailWrapperRoute).
  2. Navigate back from the wrapper route (DetailWrapperRoute) to the parent route (HomeRoute).

Expected behavior: The app should return to the parent route without any issues.

Actual behavior: The screen goes blank after navigating back from the child route, and the parent route is not displayed.

This issue occurs only when navigating back from a route with this specific nested structure and is causing disruption in the app's navigation flow.

Minimum Reproducable Code

@soultome Thanks for reporting, should be fixed in 8.1.1

@Milad-Akarie issue still persists even after upgrading to 8.1.1