StatisticsController class
Controller responsible for managing and analyzing user exercise statistics, streaks, and related information from Firestore.
Constructors
Properties
- firestore ↔ FirebaseFirestore
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDoneExercisesInSeconds(
String userEmail, {DateTime? day}) → Future< int> - Returns the total number of seconds the user exercised on a given day.
-
getDurationOfLastExercise(
String userEmail, BuildContext context) → Future< String> - Returns the duration of the last exercise session as a formatted string.
-
getLongestStreak(
String userEmail, BuildContext context) → Future< Map< String, dynamic> ?> - Retrieves the user's longest streak, either active or completed.
-
getStreakSteps(
String userEmail) → Future< int> - Returns the number of active streak steps (days) the user has maintained.
-
getTimeOfLastExercise(
String userEmail, BuildContext context) → Future< String> - Returns the time of the last completed exercise.
-
getTop3Exercises(
String userEmail) → Future< List< String> > - Returns the top 3 most performed exercises by the user based on duration.
-
getTotalExercises(
String userEmail) → Future< int> - Returns the total number of exercises the user has logged.
-
isStreakActive(
String userEmail) → Future< bool> - Checks if the user currently has an active streak.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setStreakInvalid(
String userEmail) → Future< void> - Sets the user's streak to inactive if they failed to meet the exercise requirement (less than 5 minutes) yesterday.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited