saveExerciseWithVideo function

Future<void> saveExerciseWithVideo(
  1. String name,
  2. String description,
  3. String category,
  4. String videoUrl,
)

Saves an exercise document in Firestore with provided details and video URL.

name - The name of the exercise. description - A textual description of the exercise. category - The category this exercise belongs to (e.g., "Upper-Body"). videoUrl - URL of the uploaded exercise video.

This function adds a new document to the 'exercises' collection in Firestore.

Implementation

Future<void> saveExerciseWithVideo(
    String name, String description, String category, String videoUrl) async {
  await FirebaseFirestore.instance.collection('exercises').add({
    'name': name,
    'description': description,
    'category': category,
    'video': videoUrl,
  });
}