getAllExercisesOfCategory method

Future<List<Map<String, dynamic>>> getAllExercisesOfCategory(
  1. String categoryName
)

Returns all exercises of one category.

Implementation

Future<List<Map<String, dynamic>>> getAllExercisesOfCategory(
    String categoryName) async {
  final snapshot = await firestore
      .collection('exercises')
      .where('category', isEqualTo: categoryName)
      .get();

  return snapshot.docs.map((doc) => doc.data()).toList();
}