google-maps - Flutter:从列表视图中滚动排除一个对象
问题描述
我有一个对象列表视图,其中基本上包含一个带有文本字段的表单、一个谷歌地图对象,然后是另一种形式的复选框。
我想做的是让谷歌地图对象不是整个列表视图的滚动物理的一部分,因为那样你实际上根本无法移动地图。
一些代码:
构建小部件内的构造函数:
Flexible(
child: StreamBuilder(
stream: Firestore.instance.collection('users').document(uid).snapshots(),
builder: (BuildContext context, AsyncSnapshot<DocumentSnapshot> snapshot) {
if (snapshot.hasData) {
return ListView.builder(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: 1,
itemBuilder: (context, index) =>
_buildListRows(context, snapshot.data),
);
} else {
return LoadingAnimation();
}
},
),
),
_buildListRows 小部件,简化:
Widget _buildListRows(BuildContext context, DocumentSnapshot document) {
return Container(
child: Form(
child: Column(
children: <Widget>[
Container(
child: TextFormField(),
),
Container(
child: SizedBox(
child: GoogleMap(),
),
),
Expanded(
Container(
ListView(
physics: ScrollPhysics(),
children: keys.map(key) {
return Checkbox(value: key);
}
),
),
],
),
),
);
}
快速回顾一下,我需要能够滚动地图上方和下方的对象,以上下移动整个屏幕,但在地图本身上,我需要能够控制地图,以便触摸动作适用于取而代之的是地图功能。
我已经阅读了很多关于此的内容,并尝试了一些建议,例如在该父级下方设置一个单子滚动视图,然后是列表视图,但似乎我尝试的其他任何方法都完全破坏了应用程序,并且根本不会显示任何内容。
解决方案
推荐阅读
- android - 从 Firebase 数据库问题中删除值 (Android)
- javascript - 需要滑动切换 jquery 帮助
- javascript - 在 IE 中单击输入时,Jaws 不会读取锚标记(显示/隐藏)文本更改
- javascript - 谷歌脚本表按名称获取列
- appium - 在运行时修改功能名称或在功能文件中使用环境变量/系统属性
- javascript - Array.push 为 array.push 抛出 TypeError 不是函数
- amazon-web-services - 如何为 S3 存储桶中的特定嵌套文件夹创建公共策略?
- c - 节点始终插入 GLib 树的第一个节点
- swift - 快速查找系统字体中的 unicode 字符以在按钮中设置属性标题
- java - 如何将 ItemListener 注册到 CompositeItemProcessor