简体   繁体   中英

Flutter listView(or any scrolling widget) handling google map widget events

I am using flutter. And I want to put google map widget in listView. But events live zoom in/out, rotate, move... the map are not working. Then I noticed that listView handling all events even the once that it has not like zoom in/out. Any idea what could solve this issue?

Add this line to your GoogleMap(gestureRecognizers:///Your Gestures)

gestureRecognizers: Set()..add(Factory<EagerGestureRecognizer>(() => EagerGestureRecognizer())),

Which gestures should be consumed by the map? It is possible for other gesture recognizers to be competing with the map on pointer events, eg if the map is inside a ListView the ListView will want to handle vertical drags. The map will claim gestures that are recognized by any of the recognizers on this list. When this set is empty, the map will only handle pointer events for gestures that were not claimed by any other gesture recognizer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM