I have a Collection called Channels
and a sub collection called messages
, I want to get the data of every Channels and also the data of sub collection messages
:
StreamBuilder(
stream: FirebaseFirestore.instance
.collection('Channels')
.where('particpants', arrayContains: UserInfoData.userID)
.snapshots(),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
final channesl = snapshot.data;
return StreamBuilder(
stream: FirebaseFirestore.instance
.collection('Channels')
.doc(channels[i][channelsID]) >>>> **here I want to get the messages belong to each channels**
.collection('messages')
.snapshots(),
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {},
);
},
)
how I can get the channelsID of every channels ?
I wish my question is clear