I have two different collections in firestore of similar things in flutter application. I want to combine them in one Query. How can I combine them as a one Query or Stream?
I am new to firestore and learning about this.
Query query1 = Firestore.instance.collection("products1");
Query query2 = Firestore.instance.collection("products2");
Query MasterQuery;
StreamBuilder(
stream: MasterQuery.snapshots(),
builder: (context, snapshot) {},
);builder: (context, snapshot) {
return !snapshot.hasData
? Text('PLease Wait')
: ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index) {
DocumentSnapshot products =
snapshot.data.documents[index];
return ProductItem(
name: products['name'],
imageUrl: products['imageURL'],
price: products['price'],
discription: products['description'],
);
},
);
},
How should I do it?