Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.5k stars 375 forks source link

Navigating back with iOS gesture doesn't go back to the previous page #1904

Closed eriksoderstrom closed 2 months ago

eriksoderstrom commented 2 months ago

Hello,

Starting in auto_route 7.9, when using a back gesture in a nested router, the page will pop to the initial page instead of the previous page.

This is my setup simplified:

final List<AutoRoute> routes = [
   AutoRoute(PageA.route, initial: true),
    AutoRoute(page: PageB.route, children: [
         RedirectRoute(
              path: '',
              redirectTo: 'child-router-screen',
         ),
         AutoRoute(path: 'child-router-screen', page: PageC.route)
         AutoRoute(page: PageD.route),
         AutoRoute(page: PageF.route)
         AutoRoute(page: PageE.route, fullscreenDialog: true)
    ]),
]

If I from PageC push PageD, I expect to come back to PageC when I use a back gesture on iOS. Instead I am popped to PageA. If I push PageE from PageF, I expect back gesture to be blocked, since it is a fullscreen dialog. It also pops me to PageA which is the initial page.

Is this a known issue, and is there any fix for this? I would like to use 7.9.0 to make use of the PopScope function, but this problem breaks my whole application.

Milad-Akarie commented 2 months ago

Hello @eriksoderstrom ya this was broken when we migrated to PopScope, it should be fixed in 8.0.1. confirm and close please.

eriksoderstrom commented 2 months ago

@Milad-Akarie Thanks, tested with 8.1 and issue is fixed.

liasica commented 1 month ago

@Milad-Akarie Thanks, tested with 8.1 and issue is fixed.

Same issue with version 8.1.2