Theme System
Light/Dark mode, color palettes, and persistence
Theme System
BabyShopHub supports dynamic theming, including Light Mode, Dark Mode, and custom accent colors. This is managed entirely by the ThemeProvider.
ThemeProvider Architecture
The ThemeProvider extends ChangeNotifier and persists user preferences using the shared_preferences package.
Material Theme Data
In main.dart, we consume the ThemeProvider to build the MaterialApp's theme and darkTheme properties.
Persistence
By utilizing shared_preferences, the theme state survives app restarts.
- Key
'isDarkMode': Boolean. - Key
'accentColor': Integer representing the ARGB value of the color.