FocusProfile class
Aggregated user progress across focus sessions.
Constructors
- FocusProfile({int currentStreak = 0, int longestStreak = 0, int totalPoints = 0, int totalExperience = 0, int completedSessions = 0, int cancelledSessions = 0, Duration totalFocusedDuration = Duration.zero, DateTime? lastCompletedDate, DateTime? lastActivityDate, int currentLevel = 1})
-
Creates a profile snapshot.
const
-
FocusProfile.fromJson(Map<
String, Object?> json) -
Restores a profile from JSON-compatible values.
factory
Properties
- cancelledSessions → int
-
Number of cancelled or failed sessions counted in the profile.
final
- completedSessions → int
-
Number of completed sessions.
final
- currentLevel → int
-
Current level derived from total experience.
final
- currentStreak → int
-
Number of qualifying focus days in the current streak.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastActivityDate → DateTime?
-
Timestamp of the most recent profile activity.
final
- lastCompletedDate → DateTime?
-
Start of the most recent completed focus day.
final
- longestStreak → int
-
Longest qualifying focus-day streak ever reached.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalExperience → int
-
Total experience earned by finalized sessions.
final
- totalFocusedDuration → Duration
-
Total focused duration from finalized sessions.
final
- totalPoints → int
-
Total points earned by finalized sessions.
final
Methods
-
copyWith(
{int? currentStreak, int? longestStreak, int? totalPoints, int? totalExperience, int? completedSessions, int? cancelledSessions, Duration? totalFocusedDuration, DateTime? lastCompletedDate, DateTime? lastActivityDate, int? currentLevel}) → FocusProfile - Returns a copy with selected profile fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - Converts the profile into JSON-compatible values.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited