【发布时间】:2020-11-29 09:43:37
【问题描述】:
我的目标是从路径 'chat/$chattype/room/{roomID}/message' 流式传输数据库中的所有消息,在该路径中我需要查询所有消息,这些消息的文档中的字符串包含 'user1'它,没有明确指定房间 ID。似乎无法使用通配符,但是.. 是否可以改为查询:'chat/$chattype/room/'?
Widget build(BuildContext context) {
return StreamBuilder<QuerySnapshot>(
stream: _firestore
.collection('chat/$chattype/room/{roomID}/message')
.where("reciever", isEqualTo: "user1")
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
...
【问题讨论】:
标签: flutter google-cloud-firestore stream-builder