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

Duplicated page are not saved during state restoration #2040

Open
BarashkovaElena opened this issue Aug 19, 2024 · 0 comments
Open

Duplicated page are not saved during state restoration #2040

BarashkovaElena opened this issue Aug 19, 2024 · 0 comments

Comments

@BarashkovaElena
Copy link

I have an issue with restoring navigation state.
In my test app there is a couple of pages. Sign-up page is initial.

@AutoRouterConfig(replaceInRouteName: 'Screen|Page,Route')
class AppRouter extends RootStackRouter {
  @override
  List<AutoRoute> get routes => [
        AutoRoute(
          page: SignUpRoute.page,
          initial: true,
        ),
        AutoRoute(
          page: ExternalRoute.page,
        ),
}

Steps to reproduce the issue.

  1. Set "Don't keep activities" flag on Android device.
  2. Open the app.
  3. Call context.router.replace(const ExternalRoute());
  4. Call context.router.push(const ExternalRoute());
  5. Call context.router.push(const ExternalRoute());
  6. Put the app to background.
  7. Restore the app.
    Expected result: 3 instances of ExternalRoute are restored. Like /external-route/external-route/external-route. So that back button returns to the second ExternalRoute, then to the first ExternalRoute, then closes the app.
    Actual result: back button closes ExternalRoute, SignUpRoute shows.
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