saveExerciseWithVideo function
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,
});
}