Preferences Repository
Component Detail
Data Layer
low complexity
mobile
0
Dependencies
5
Dependents
0
Entities
0
Integrations
Description
Persists user preferences using a dual-storage strategy: flutter_secure_storage for sensitive values and the REST API endpoint /api/v1/users/preferences for cross-device sync. Provides a unified read/write interface so callers do not need to differentiate storage backends.
preferences-repository
Responsibilities
- Read and write notification preference toggles to local storage and backend API
- Persist language and theme selections locally and sync to backend
- Clear all local preference data on logout
- Expose a Riverpod StateNotifier for reactive preference propagation
Interfaces
getPreferences(): Future<UserPreferences>
updatePreferences(UserPreferences prefs): Future<void>
clearLocalPreferences(): Future<void>
syncFromRemote(): Future<void>
Relationships
Dependents (5)
Components that depend on this component