Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 如何用颤振在火场哪里使用?_Firebase_Flutter_Dart_Where Clause - Fatal编程技术网

Firebase 如何用颤振在火场哪里使用?

Firebase 如何用颤振在火场哪里使用?,firebase,flutter,dart,where-clause,Firebase,Flutter,Dart,Where Clause,我已经使用firebase构建了一个应用程序,我还构建了一个StreamBuilder来从我的集合中检索数据,但问题是我有一个ID列表,我希望其中的每个项目都有where方法 我现在只需要在列表的第一项上做这个 我该怎么办 我的代码:- StreamBuilder( 流:_firestore .collection('博客') //问题就在这里 .where('writerID',isEqualTo:followingUserPostsID[0]) .snapshots(), 生成器:(上下文、

我已经使用firebase构建了一个应用程序,我还构建了一个StreamBuilder来从我的集合中检索数据,但问题是我有一个ID列表,我希望其中的每个项目都有where方法

我现在只需要在列表的第一项上做这个

我该怎么办

我的代码:-

StreamBuilder(
流:_firestore
.collection('博客')
//问题就在这里
.where('writerID',isEqualTo:followingUserPostsID[0])
.snapshots(),
生成器:(上下文、快照){
试一试{
如果(!snapshot.hasData){
返回中心(
孩子:纺纱机(
颜色:主题。背景。原色,
),
);
}
var snapshotDocuments=snapshots.data.documents;
如果(快照==null){
返回中心(
孩子:纺纱机(
颜色:主题。背景。原色,
),
);
}
扩大回报(
子项:ListView.builder(
收缩膜:对,
itemCount:snapshotDocuments.length,
itemBuilder:(上下文,索引){
返回博客(
用户标识:
快照文档[索引]。数据['writerID'],
networkImage:Image.network(
快照文档[index]。数据['postPhoto'],
),
postDesc:
快照文档[index]。数据['postDesc'],
职称:
快照文档[索引]。数据['postTitle'],
);
},
),
);
}捕获(e){
返回中心(
孩子:纺纱机(
颜色:主题。背景。原色,
),
);
}
},
),

你可以用
where
代替
where
。我找不到它为什么?我可以看到它的声明。你使用的是最新版本吗?你能发布你的代码吗?我根本不理解这个问题。而且,我觉得发布的代码很好。