简体   繁体   English

Flutter listView(或任何滚动小部件)处理谷歌 map 小部件事件

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

I am using flutter.我正在使用 flutter。 And I want to put google map widget in listView.我想把谷歌 map 小部件放在 listView 中。 But events live zoom in/out, rotate, move... the map are not working.但是事件实时放大/缩小、旋转、移动...... map 无法正常工作。 Then I noticed that listView handling all events even the once that it has not like zoom in/out.然后我注意到 listView 处理所有事件,即使它不喜欢放大/缩小。 Any idea what could solve this issue?知道什么可以解决这个问题吗?

Add this line to your GoogleMap(gestureRecognizers:///Your Gestures)将此行添加到您的GoogleMap(gestureRecognizers:///Your Gestures)

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

Which gestures should be consumed by the map? 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.其他手势识别器可能会在指针事件上与 map 竞争,例如,如果 map 在 ListView 内,则 ListView 将要处理垂直拖动。 The map will claim gestures that are recognized by any of the recognizers on this list. map 将声明被此列表中的任何识别器识别的手势。 When this set is empty, the map will only handle pointer events for gestures that were not claimed by any other gesture recognizer.当此集合为空时,map 将仅处理任何其他手势识别器未声明的手势的指针事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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