"How to Calculate Total Time and Calories in Firestore When Adding Completed Yoga Exercises"

Actions & Logic

I have a yoga app where users complete exercises and press a "complete" button to add the exercise to an array of maps within a Firestore document. Each exercise has a different duration (time) and calorie burn (kcal).

I want to calculate the total time and total kcal each time a new exercise is added to this array. My Firestore structure includes a document for each date. If today's date matches an existing document, I add the completed exercise to that document. If not, I create a new document for the current date and add the exercise to it.

How can I calculate the total_time and total_kcal when a new exercise is added to the array in Firestore?

What have you tried so far?

i dont understand how to do this im beginner at flutter flow

Did you check FlutterFlow's Documentation for this topic?
No
3
2 replies