简体   繁体   中英

Flutter Gesture Detection for Widget at the bottom of Stack

I am trying to develop an interface similar to Google Maps using Flutter. My Flutter UI consists of a stack Widget, with the following child Widgets:

  1. GoogleMaps (using the google maps plugin)
  2. CustomScrollView with slivers (SliverPersistentHeader & SliverList)

I have made the SliverPersistentHeader be transparent so that the Google Maps shows below it. It looks fine, the only issue is GoogleMap could not get any gestures so it could not react to drag or tap gestures.

Any idea, how can I push the gestures down from the SliverHeader to GoogleMaps?

Here is a graphical representation of how the UI looks like.

在此处输入图片说明

我认为一种解决方案是使用IgnorePointer小部件作为SliverHeader的父级,因为它会使所有子树在命中测试时不可见。

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