Skip to content

How should Cupertino back gesture interact with onPopPage  #137458

@chunhtai

Description

@chunhtai

Is there an existing issue for this?

Steps to reproduce

Currently the Cupertino back gesture assumes its pop will always remove the route, however it missed the case where onPopPage can still veto the pop. Right now, this will cause the page to hang.

The question is what should they do in this case. I can think several ways forward.

  1. onPopPage can veto the pop, then we have to fix the cupertino back swipe to not freeze the screen if it is veto'd
  2. page based route will disable cupertino back swipe.
  3. cupertino backswipe can't be veto by onPopPage.

It seems to me (2) or (3) is closer to the current cupertino back swipe behavior, but (2) may be too aggressive. If we want to implement (3) we will need a new API in Navigator to still give customer a chance to clean up their page list.

Actual results

fix the issue.

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor output
<!-- Paste your output here -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions