Reputation: 1313
I've two stream
Stream<QuerySnapshot> s1 = users.where("uid",isNotEqualTo: "--").snapshots();
Stream<QuerySnapshot> s2 = groups.snapshots();
And i want single stream
return s1+s2;
I also tried StreamGroup but facing this same issue;
Please do not send link, If you can do it via code then that will be helpful a lot.
Upvotes: 1
Views: 196
Reputation: 1313
CombineLatestStream is the solution.
CombineLatestStream<QuerySnapshot, List<QuerySnapshot>> roomStream() {
try {
Stream<QuerySnapshot> s1 = users.where("uid",isNotEqualTo: firebaseAuth.currentUser.uid).snapshots();
Stream<QuerySnapshot> s2 = groupService.streamGroup();
return CombineLatestStream.list<QuerySnapshot>([s1,s2]);
} catch (e) {
handleException(e);
throw e;
}
}
Thanks pskink
Upvotes: 1