Theme Service
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Core service that reads persisted accessibility preferences from ThemeRepository and constructs a Flutter ThemeData object applied at the MaterialApp level. Responds to preference changes at runtime, rebuilding the theme without requiring an app restart.
theme-service
Responsibilities
- Build ThemeData from stored font scale and contrast theme preferences
- Apply textScaleFactor at MaterialApp level for consistent scaling
- Subscribe to preference changes and notify listeners
- Provide the active theme to the widget tree via provider or inherited widget
Interfaces
initialize()
getActiveTheme()
applyFontScale(double scale)
applyContrastTheme(ContrastTheme theme)
savePreferences(AccessibilityPreferences prefs)
resetToDefaults()
watchThemeChanges(Stream<ThemeData>)
getTextScaleFactor()
Related Data Entities (2)
Data entities managed by this component