auto_route_library
auto_route_library copied to clipboard
Duplicated page are not saved during state restoration
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.
- Set "Don't keep activities" flag on Android device.
- Open the app.
- Call context.router.replace(const ExternalRoute());
- Call context.router.push(const ExternalRoute());
- Call context.router.push(const ExternalRoute());
- Put the app to background.
- 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.