Preferences Service
Component Detail
Service Layer
medium complexity
mobile
2
Dependencies
2
Dependents
1
Entities
0
Integrations
Description
Handles all reads and writes for user preferences, persisting to the backend REST API for cross-device consistency and caching the latest snapshot in Drift for offline access. Manages the ThemeExtension pipeline update when accessibility overrides change, ensuring text scale and high-contrast propagate app-wide without per-screen handling. Coordinates biometric toggle by delegating credential operations to Secure Token Store.
preferences-service
Responsibilities
- Fetch user preference snapshot from REST API on session start and write changes back on mutation
- Cache the latest preference snapshot in Drift so settings are available offline
- Apply ThemeExtension and MediaQuery overrides when text scale or high-contrast preference changes
- Delegate biometric toggle enable/disable to Secure Token Store
- Filter available languages to those with complete localization bundles before exposing to UI
Interfaces
getPreferences() → UserPreferences
updatePreference(PreferenceKey key, dynamic value) → Future<void>
applyThemeOverrides(UserPreferences prefs) → ThemeExtension
getAvailableLanguages() → List<SupportedLanguage>
syncPreferencesFromRemote() → Future<UserPreferences>
clearLocalCache() → Future<void>
Relationships
Dependencies (2)
Components this component depends on
Dependents (2)
Components that depend on this component