Flutter Multiple Firestore Queries. For anyone in future who might need assistance with this, I managed to solve it using StreamZip. You can read more about it from this website
1 2 3 4 5 6 7 8 9 10 11 12 13 | import 'package:async/async.dart'; Stream<DocumentSnapshot> stream1 = firestore.document('/path1').snapshots(); Stream<DocumentSnapshot> stream2 = firestore.document('/path2').snapshots(); StreamZip bothStreams = StreamZip([stream1, stream2]); // To use stream bothStreams.listen((snaps) { DocumentSnapshot snapshot1 = snaps[0]; DocumentSnapshot snapshot2 = snaps[1]; // ... }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.