processRoomsQuery function
Returns a list of types.Room created from Firebase query. If room has 2 participants, sets correct room name and image.
Implementation
Future<List<types.Room>> processRoomsQuery(
User firebaseUser,
FirebaseFirestore instance,
QuerySnapshot<Map<String, dynamic>> query,
String usersCollectionName,
) async {
final futures = query.docs.map(
(doc) => processRoomDocument(
doc,
firebaseUser,
instance,
usersCollectionName,
),
);
return await Future.wait(futures);
}