flutter_inner_drawer
flutter_inner_drawer copied to clipboard
Add drawerEdgeDragWidth
Is it possible to add new property, that specifies the width of the area within which a horizontal swipe will open the drawer (like drawerEdgeDragWidth in default scaffold Drawer).
@arastataryn yes, it's possible. why would you like to change this value?
for example, I have full screen map in my app, and I want to drag it around, but it captures gesture and opens drawer (when I swipe left/right), instead of the interacting with the map
@tarastataryn if that's what I imagine it is, you should look here GestureRecognizer and Example
@tarastataryn solved?
Hi @Dn-a,
I'm trying to do the same thing and came across the same problem.
What is happening is the GuestureDetector inside the build method is receiving the drag events which need instead be intercepted by the map thus stopping you panning around the map.
GestureDetector(
key: _gestureDetectorKey,
onTap: () {},
onHorizontalDragDown: widget.swipe ? _handleDragDown : null,
onHorizontalDragUpdate: widget.swipe ? _move : null,
onHorizontalDragEnd: widget.swipe ? _settle : null,
...
}
I think the way you could implement this is to have the Gesture detectors (you'll probably want one one each side) at the same level in the widget hierarchy as the first stack and give them a specific width for the grab tabs.
James
@JamesMcIntosh gesturerecognizer does just that, I use it in my app to intercept google maps gestureDetector and it works perfectly ...Google maps
Ah, that improves the situation a lot but if I try to horizontally pan anywhere on the map the situation still occurs with the drawer taking precedence. The only way I can get the map to scroll horizontally if if I start with a vertical scroll which I then turn into a horizontal scroll without lifting my finger...
@JamesMcIntosh you have to try them all
gestureRecognizers: Set()
..add(Factory<PanGestureRecognizer>(() => PanGestureRecognizer()))
..add(Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()))
..add(Factory<TapGestureRecognizer>(() => TapGestureRecognizer()))
..add(Factory<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer())),
Yes, that's exactly what I have and HorizontalDragGestureRecognizer.
@Dn-a, are you able to pan the map horizontally without opening the drawer?
@JamesMcIntosh yes...have you solved?
Hi @Dn-a, it's still causing me an issue, I will try and strip it back to make a standalone example.