Accessibility Preferences Repository
Component Detail
Data Layer
low complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Manages persistence and retrieval of per-user accessibility preference records from the Supabase backend, including cognitive mode, font scale, and contrast theme settings. Acts as the single source of truth for all accessibility configuration consumed by CognitiveModeService, ThemeService, and related services.
accessibility-preferences-repository
Responsibilities
- Perform CRUD operations on the accessibility_preferences table for a given user
- Cache preferences locally using Hive or shared preferences to support offline access
- Merge server-side preferences with local overrides on reconnect
- Provide a typed AccessibilityPreferences model for consumers
- Emit change events when preferences are updated from any source
Interfaces
Future<AccessibilityPreferences?> getPreferences(String userId)
Future<void> savePreferences(AccessibilityPreferences prefs)
Future<void> updateCognitiveMode(String userId, bool enabled)
Future<void> updateFontScale(String userId, double scale)
Future<void> updateContrastMode(String userId, String contrastLevel)
Future<void> resetToDefaults(String userId)
Stream<AccessibilityPreferences> watchPreferences(String userId)
Related Data Entities (1)
Data entities managed by this component