getAllExercises method

Future<List<Map<String, dynamic>>> getAllExercises()

Returns all exercises.

Implementation

Future<List<Map<String, dynamic>>> getAllExercises() async {
  try {
    final snapshot =
        await FirebaseFirestore.instance.collection('exercises').get();
    return snapshot.docs.map((doc) => doc.data()).toList();
  } catch (e) {
    return [];
  }
}