flutter - 快照适用于 Documents[index] 但不适用于 Document(ID)
问题描述
我想访问基于文档 ID 而不是文档索引的流生成器。请帮忙。
StreamBuilder(
stream: Firestore.instance.collection('users').snapshots(),
builder: (context, snapshot){
if(!snapshot.hasData) return Text('Loading data.....');
return
Center(child: Text(snapshot.data.documents[0]["Name"]),);
解决方案
推荐阅读
- java - 当类路径中存在 eclipse moxy jar 时,不考虑 jersey jackson 提供程序
- reactjs - 在路由上显示登录组件,但如果用户不存在,也会显示
- hive - 为什么插入hdfs hive分区表时速度太慢?
- php - 速记如果疯狂,是否可以更聪明地重写?
- c# - 如何使用私钥使用 rsa-sha256 对字符串进行签名?
- java - 将简单 json 字符串中所有项目的键和值打印到控制台
- java - 如何在不进行任何修改的情况下从 Java 中的 Rabbit 接收原始 json 字符串?
- indexing - AEM : 房地产指数
- download - 下载带有依赖项的巧克力包,但稍后安装
- php - 无法在 Ubuntu 18.04 上加载 SimpleXML