Stacked-Org/stacked

[bug]: CupertinoRoute do not respect PopScope when allowing swipe-to-dismiss

Closed this issue · 0 comments

Describe the bug

When using a route created by using CupertinoRoute() in the @StackedApp annotation, the iOS swipe-to-pop gesture ignores PopScope(canPop: false). This means users can swipe back to pop a route that is not typically able to be popped.

What operating system do you use?

macOS

Information about the installed tooling

No response

Steps to reproduce the issue

  1. Add a CupertinoRoute(page: MyPopScopePage) to the routes list in the @StackedApp annotation.
  2. Create a new page named MyPopScopePage and add a PopScope(canPop: false) widget to the page.
  3. Navigate to the MyPopScopePage from another page using the RouterService navigateToMyPopScopePage() function.
  4. The page will not be able to be popped via Android back buttons or Scaffold back buttons, but will be able to be popped via swiping from the left side of the screen.

Expected behavior

Setting PopScope(canPop: false) should block any attempt to swipe the side of the page, similar to the behavior when using the now deprecated WillPopScope() and returning false in the onWillPop callback.

Screenshots

No response

Additional Context

No response