Open Bricktheworld opened 4 years ago
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 1) Replaced constant back gesture width (20.0) with configurable one
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
should be fixed on #7
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