gpt4 book ai didi

flutter - 如何使该折叠栏与我的Google map 一起显示?

转载 作者:行者123 更新时间:2023-12-03 03:32:22 24 4
gpt4 key购买 nike

在了解抖动设计的来龙去脉方面存在问题...有人知道我如何才能使折叠导航侧栏适合我的Google Map?我希望 map 在它的右边。我在 map 上还以堆栈的形式有一些 float 文本小部件。如果我删除自己的Google map ,则该条会显示并正常工作。启用我的 map 后看不到它。

return Stack(children: [
Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: true,
appBar: AppBar(
elevation: 0.0,
backgroundColor: drawerBackgroundColor,
title: Text(
"Collapsing Navigation Drawer/Sidebar",
),
),
body: Stack(children: <Widget>[
Container(
color: selectedColor,
),
CollapsingNavigationDrawer(),
Stack(children: <Widget>[
Container(
child: GoogleMap(
markers: Set<Marker>.of(markers.values),
initialCameraPosition:
CameraPosition(target: LatLng(lat, lng), zoom: 10.0),
myLocationEnabled: true,
compassEnabled: true,
myLocationButtonEnabled: true,
mapType: MapType.normal,
onMapCreated: (GoogleMapController controller) {
controller.setMapStyle(Utils.mapStyles);
}),
),

最佳答案

Stack需要多个子项,并从下到上对其进行排序。因此,第一个项目是最底端的,最后一个是最高端的。因此,首先放置 map ,然后放置CollapsingNavigationDrawer

Stack(children: <Widget>[
Stack(children: <Widget>[
Container(
child: GoogleMap(
markers: Set<Marker>.of(markers.values),
initialCameraPosition:
CameraPosition(target: LatLng(lat, lng), zoom: 10.0),
myLocationEnabled: true,
compassEnabled: true,
myLocationButtonEnabled: true,
mapType: MapType.normal,
onMapCreated: (GoogleMapController controller) {
controller.setMapStyle(Utils.mapStyles);
}),
),
CollapsingNavigationDrawer(),
]

关于flutter - 如何使该折叠栏与我的Google map 一起显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63205484/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com