Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the back gesture to not override any other gesture that is not in the same direction #1

Open
Bricktheworld opened this issue Mar 27, 2020 · 3 comments

Comments

@Bricktheworld
Copy link

Basically I have a bunch of dismissible views, but when I use this plugin with the whole page set as the swipe back gesture, I am unable to dismiss my views in the other direction. Would it be possible to make it so that the gesture does not override these (meaning the right to left gesture) and only the left to right gesture?

Thank you! Love the plugin btw

@PiN73
Copy link
Owner

PiN73 commented Mar 30, 2020

Honestly I don't have deep understanding how does gesture disambiguation works in Flutter.

The way I've made this package is

  1. Forked CupertinoPageRoute class from Flutter source
  2. Replaced constant back gesture width (20.0) with configurable one

@PiN73
Copy link
Owner

PiN73 commented Mar 30, 2020

Swipe detection in CupertinoPageRoute is implemented this way:

Stack(
  fit: StackFit.passthrough,
  children: <Widget>[
    widget.child,
    PositionedDirectional(
      start: 0.0,
      width: dragAreaWidth,
      top: 0.0,
      bottom: 0.0,
      child: Listener(
        onPointerDown: _handlePointerDown,
        behavior: HitTestBehavior.translucent,
      ),
    ),
  ],
)

e.g. Listener in on top of the page content. So it captures horizontal swipes that occurs on its area.

There exists an issue about CupertinoPageRoute's swipe precedence. OP wants to make Slider draggable from the very left edge of the screen

@theSharpestTool
Copy link

should be fixed on #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants