我正在构建一个应用程序,我试图在当前用户关注的人的提要页面中显示所有帖子。 它运行良好,但我的问题是 WhereIn 限制.. 如何在 FutureBuilder 中规避此限制?
代码如下:
buildFeed() {
return FutureBuilder(
future: storiesRef
.where('uid', whereIn: widget.userIds)
.orderBy('timeStamp', descending: true)
.get(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return loading();
}
final stories = snapshot.data.docs;
List<StoryTickets> tickets = [];
for (var story in stories) {
List<String> categories = List.from(story.data()['categories']);
StoryTickets ticket = StoryTickets(
displayName: story.data()['displayName'],
categories: categories,
storyId: story.data()['sid'],
commentId: story.data()['cid'],
ownerId: story.data()['uid'],
rating: story.data()['rating'].toString(), //TODO: maybe delete
storyPhoto: story.data()['storyPhoto'],
timestamp: story.data()['timeStamp'],
title: story.data()['title'],
);
tickets.add(ticket);
}
return ListView(
children: tickets,
);
},
);
}