Google maps 当触摸屏集中在另一个小部件上时,如何防止滑动应用程序条滚动

Google maps 当触摸屏集中在另一个小部件上时,如何防止滑动应用程序条滚动,google-maps,dart,flutter,uiscrollview,Google Maps,Dart,Flutter,Uiscrollview,我有一个滑动应用条,当用户向下滚动页面时,我想隐藏它。问题是,我有一个谷歌地图小部件,它也会导致应用程序栏移动,而我只希望它在我的触摸离开谷歌地图时移动。有办法去吗 @覆盖 小部件构建(构建上下文){ 返回安全区( 孩子:脚手架( 正文:自定义滚动视图( 条子:[ 滑杆( 背景颜色:颜色。透明, 标高:5.0, 错,, 快照:错, 浮动:假, 扩展高度:200, flexibleSpace:FlexibleSpaceBar( 背景:Image.asset( '资产/事件/城市.jpeg', 适合

我有一个滑动应用条,当用户向下滚动页面时,我想隐藏它。问题是,我有一个谷歌地图小部件,它也会导致应用程序栏移动,而我只希望它在我的触摸离开谷歌地图时移动。有办法去吗

@覆盖
小部件构建(构建上下文){
返回安全区(
孩子:脚手架(
正文:自定义滚动视图(
条子:[
滑杆(
背景颜色:颜色。透明,
标高:5.0,
错,,
快照:错,
浮动:假,
扩展高度:200,
flexibleSpace:FlexibleSpaceBar(
背景:Image.asset(
'资产/事件/城市.jpeg',
适合:BoxFit.cover,
),
),
),
剩余碎片(
子:SingleChildScrollView(
子:列(
儿童:[
填充物(
填充:常数边集全部(16.0),
子:容器(
身高:200,
宽度:double.infinity,
孩子:谷歌地图(
初始摄像机位置:
摄像机位置(目标:LatLng(50.0,50.0)),
onMapCreated:(控制器){
设置状态(){
_googleMapController=控制器;
});
},
),
),
)
],
),
),
)
],
),
));
}

我发现,在GoogleMap中添加一个gestureRecognizer属性并传入VerticalDragRecognizer类型的工厂,可以防止滑动应用条滚动。它也适用于任何类型的应用程序滚动。有关50分钟标志的更多信息,请参阅

SliverFillRemaining(
    child: SingleChildScrollView(
      child: Column(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(16.0),
            child: Container(
              height: 200,
              width: double.infinity,
              child: GoogleMap(
                gestureRecognizers: Set()..add(Factory<VerticalDragGestureRecognizer>(
                    () => VerticalDragGestureRecognizer()
                )),
                scrollGesturesEngabled: true,
                initialCameraPosition:
                    CameraPosition(target: LatLng(50.0, 50.0)),
                onMapCreated: (controller) {
                  setState(() {
                    _googleMapController = controller;
                  });
                },
              ),
            ),
          )
        ],
      ),
    ),
  )
sliverfill剩余(
子:SingleChildScrollView(
子:列(
儿童:[
填充物(
填充:常数边集全部(16.0),
子:容器(
身高:200,
宽度:double.infinity,
孩子:谷歌地图(
手势识别器:Set()…添加(工厂)(
()=>VerticalDraggesturererecognizer()
)),
滚动手势:正确,
初始摄像机位置:
摄像机位置(目标:LatLng(50.0,50.0)),
onMapCreated:(控制器){
设置状态(){
_googleMapController=控制器;
});
},
),
),
)
],
),
),
)
SliverFillRemaining(
    child: SingleChildScrollView(
      child: Column(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(16.0),
            child: Container(
              height: 200,
              width: double.infinity,
              child: GoogleMap(
                gestureRecognizers: Set()..add(Factory<VerticalDragGestureRecognizer>(
                    () => VerticalDragGestureRecognizer()
                )),
                scrollGesturesEngabled: true,
                initialCameraPosition:
                    CameraPosition(target: LatLng(50.0, 50.0)),
                onMapCreated: (controller) {
                  setState(() {
                    _googleMapController = controller;
                  });
                },
              ),
            ),
          )
        ],
      ),
    ),
  )