PreferencesRepository class
Manages app preferences: demo mode, color customizations, onboarding status.
Supports cloud sync by embedding preferences as MessagePack in the avatar file uploaded to NTUT's portal. See syncUp and syncDown.
Constructors
- PreferencesRepository({required SharedPreferencesAsync prefs, required PortalService portalService, required AppDatabase database, required AuthRepository authRepository})
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
-
get<
T> (PrefKey< T> key) → Future<T> - Gets a preference value, returning the key's default if not set.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set<
T> (PrefKey< T> key, T value) → Future<void> - Sets a preference value and marks local state as dirty for cloud sync.
-
syncDown(
) → Future< void> - Downloads the avatar and restores embedded preferences if present.
-
syncOnLaunch(
) → Future< void> - Syncs preferences with the cloud on app launch.
-
syncUp(
) → Future< void> - Uploads preferences embedded in the current avatar.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited