getGroup method

Future<Group?> getGroup(
  1. String groupId
)

Gets a group by ID

Implementation

Future<Group?> getGroup(String groupId) async {
  try {
    final docSnapshot = await _firestore.collection(_collectionPath).doc(groupId).get();

    if (docSnapshot.exists) {
      return Group.fromMap(docSnapshot.data()!, groupId);
    }
    return null;
  } catch (e) {
    print('Error getting group: $e');
    rethrow;
  }
}