flutter - 从嵌套的 Firstore 子集合中获取特定文档到流构建器
问题描述
所以,我正在尝试显示一个文档字段,但如果我从前一页输入,它就不起作用。如何从材料页面路径显示这种类型的子集合,我的颤振应用程序不断崩溃。
new StreamBuilder(
stream: Firestore.instance
.collection("Users")
.document(uid) //from firestore getuserID
.collection("orders")
.document(widget.doc) //from materialpageroute fetched data
.snapshots(),
或者这还不支持?
解决方案
它给出错误,因为您来自 Firestore 的数据是 A DocumentSnapshot 类型的数据。但是在您的 StreamBuilder 中,您必须指定 QuerySnapshot 类型的数据
推荐阅读
- angular - 可以从输入字段中禁用“管理密码”吗?
- java - MultipartFile 到 inputStream NullPointErexception
- javascript - ajax itno axios的beforeSend如何转换
- javascript - 如何指定哪张图片在顶部?
- vuejs3 - Vetur 在 Visual Studio Core 中将格式 2 个空格更改为 4 个空格
- servicestack - OrmLite可以为除主键之外的属性指定外键吗
- ios - 如何从 UITextField 中排除文本以使 alpha 透明?
- html - 在 Shopify 上添加指向 vimeo 视频的链接
- oracle - 出现错误 -> 发现“开始”期待外部语言
- php - 为简单功能寻找可能的代码覆盖路径