I have a firebase document structured as chats/groupchatID/messages/message where GroupchatId is the combination of 2 user Ids such as ID2ID1 or ID1ID2. I have a page that has a listview builder that needs a snapshot of the other user to create the listview for them and to open the groupchats
I currently display the list by displaying all users such as
child: FutureBuilder(
future: FirebaseFirestore.instance
.collection('users')
.where(
'uid',
isNotEqualTo: FirebaseAuth.instance.currentUser!.uid,
)
.orderBy('uid', descending: true)
.get(),
builder: (context, snapshot) {
Im trying to now change it to show only the groupchats that exist in the firebase that the user is in. How can I return only thr groupchats the current user is in like is there a way I can check for substrings in firebase and then would I have to do another firebase query for each list tile to get the data for that user as that seems inefficient