auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

Handling of back navigation in nested routes, ignored PopScope

Open HE-LU opened this issue 1 month ago • 3 comments

Hey, I am trying to understand how the Nested navigation is actually working, and why the PopScope is ignored. Also, I am looking for a way how to implement the following functionality:

  • I have a sample app with quite a long "onboarding". Each of the children's routes is a separate step.
  • IdentityVerificationRoute is a wrapper screen, that has AppBar, some fancy wrapping, and contains AutoRouter to display children.
  • Some of those screens actually have two states, and when the user hits the back button, I would like to STAY on that page. Sadly PopScope is not handled at all, and works correctly only on the first step, where the back button would invoke exiting the flow completely.

image

I am not sure if this is a bug or if I am just missing something. Is there another way how I should limit the back navigation? In the most ideal case, I would love to handle and limit the back directly on the specific step. Sadly, the PopScope is completely ignored there.

HE-LU avatar May 21 '24 15:05 HE-LU