getMessageCount method

Future<int> getMessageCount(
  1. String roomId
)

Implementation

Future<int> getMessageCount(String roomId) async {
  final querySnapshot = await getFirebaseFirestore
      .collection('${FireChatConst.roomsCollectionName}/$roomId/messages')
      .get();

  return querySnapshot.size;
}