flutter - DraggableScrollableView 和 GoogleMaps - 地图显示为白色空白页
问题描述
我正在尝试将 DraggableScrollableSheet 用作 Scaffold bottomSheet 和带有 Google Maps 的主体,但到目前为止还没有运气。有什么提示可能是错的吗?
return Scaffold(
appBar: AppBar(
title: Text("Meeting"),
backgroundColor: Colors.black,
automaticallyImplyLeading: false,
),
body: Stack(
children: <Widget>[
GoogleMap(
markers: Set<Marker>.of(markers.values),
// YOUR MARKS IN MAP
initialCameraPosition: CameraPosition(
target: LatLng(47.502941, 18.999161),
zoom: 1),
myLocationEnabled: true,
zoomControlsEnabled: true,
),
],
),
bottomSheet: DraggableScrollableSheet(
initialChildSize: 0.3,
minChildSize: 0.1,
maxChildSize: 0.9,
builder: (context, scrollController) {
return SingleChildScrollView(
child: Card(
Text("test"),
);
},
),
,
bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.white,
selectedItemColor: Colors.black,
unselectedItemColor: Colors.black,
iconSize: 26,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.close),
),
BottomNavigationBarItem(
icon: Icon(Icons.check),
),
],
));
}
}
解决方案
我不知道到底出了什么问题。但我一直使用可拖动工作表的方式是将其与主视图放在一个堆栈中。你可以试试。如果问题与谷歌地图有关,那么您可以检查地图 api 密钥是否设置正确。
推荐阅读
- angular - 修改 Angular 服务中的 api 响应
- python - 使用 numba 加速 odeint,尝试传递字典和自定义对象时出现问题
- bitbucket - 自定义 Bitbucket 合并检查 - 提交配置后动态字段呈现两次
- webpack - Webpack 没有编译全局样式
- javascript - D3 - 如何在数据值更改时更新力模拟
- powershell - 在powershell的键/值查找表中使用正则表达式?
- node.js - 使用 mongoClient 连接池连接不同的用户
- flutter - 试图将 DocumentID 从 ListView 传递给 ¨ Like ¨ 函数
- python - 循环通过两个单独的数据帧,Haversine 函数,存储值
- google-chrome - 控制台可以与网络面板交互吗?