Mastery class

Centralized mastery level logic used across the app.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

canSelfOverride(String current, String target) → bool
Whether a self-override from current to target is allowed. Users can skip forward at most 2 levels, and never directly to 'mastery'.
effectiveMastery(List<String> childMasteries, [String? ownMastery]) → String
Compute effective mastery for a parent topic from its children's mastery values. Returns 'in_progress' when children have mixed mastery levels.
masteryIntFromLabel(String mastery) → int
Maps a mastery label to its 0..5 index on the ramp. The synthetic 'in_progress' state returns 0 — callers that want the parent-rollup appearance should pass inProgress: true to MasteryRing instead.
nextMastery(String current, String sessionMode) → String?
Returns the next mastery level if the completed session mode matches the expected progression, or null if no advancement applies.
validationModeForLevel(String targetLevel) → String?
Returns the session mode used to validate a given mastery level.

Constants

levels → const List<String>
Ordered mastery levels from lowest to highest.