-
-
Notifications
You must be signed in to change notification settings - Fork 856
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
bugfix: Prevent parent ListView widgets from snatching scrolling gestures #717
Conversation
674d52d
to
c00da64
Compare
How to add it into my project? Do you have a example code? |
If you want to use the fork, put the following in your pubspec.yaml
|
Sadly I can't use your git version because of flutter_map_marker_cluster.
Or am I doing something wrong? So far, I've never added a package directly from Git. But apart from the possibility to add your great customization via Git, this would be a very important feature and I can't understand why this is still not officially available in flutter_map...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work for me 👍
@ritikmishra I'm interested to know that how it works @johnpryan Please accept the PR |
The mechanism through which Flutter recognizes gestures is called the gesture arena. Different gesture recognizers compete in the arena, and the first recognizer to accept the gesture, or the last recognizer remaining in the arena (i.e the other recognizers rejected the gesture), is responsible for handling it. Previously, the map was implicitly using 3 gesture recognizers through The problem was caused by the The solution was to use a |
@ritikmishra as the PR is not merged, is there alternative solution , for example wrapping map with another widget? |
I couldn't find a workaround, which is why I made this PR. If you can find some way to stop the ListView from being so greedy in the gesture arena & ensure that the pointer events from gestures that don't go to the ListView do go to the FlutterMap, that should fix the problem. |
@johnpryan can you please take a look? |
@ritikmishra Can you resolve the conflict and update this PR? I can review it when this is done. |
117f79e
to
d0bd0e9
Compare
@kengu i have resolved the conflict |
(layer) => _createLayer(layer, options.plugins), | ||
) | ||
], | ||
child: scaleGestureDetector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly @ritikmishra, the TeamGestureRecognizer will always ensure that flutter_map takes precedence over ListView scoll? I don't think we can conclude that this is the only behaviour user expect. I think we need to make this behavior configurable, just as it is for scollables in general. I think we should add something similar (or equal) to scrollPhysics to MapOptions constructor.
@johnpryan? What do you think?
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Hi guys I think @kengu makes a good point to make this configurable. Is anyone looking into this? |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Closing, fixed by #994. |
Closes #253.
The issue was fixed by using a
GestureArenaTeam
in conjunction with extra gesture recognizers to ensure that theScalingGestureRecognizer
wins when we would expect it to do so.