Overview
A Flutter package that enables dynamic theme mode switching at runtime and persists the selected theme across app restarts. It simplifies handling light and dark mode preferences by automatically saving the user's choice to shared preferences, ensuring consistency when the app is reopened. The widget integrates seamlessly into existing Flutter apps with minimal setup, offering a reliable way to manage theme state without manual storage logic.
Use cases
- Dynamic theme switching in mobile apps
- Persisting user theme preference across sessions
- Implementing dark mode toggle in web applications
- Supporting system theme awareness
- Enabling theme customization in desktop apps
Key features
- Runtime theme mode changes
- Automatic persistence using shared preferences
- Simple integration with MaterialApp
- Supports all major platforms
- Configurable default theme mode
Suitable for
- Developers building apps with theme toggles
- Apps requiring persistent user theme settings
- Cross-platform applications targeting multiple devices
Considerations
- Requires shared_preferences dependency
- Limited to themeMode only (not full theme customization)
- May need additional logic for custom themes
- Not suitable for complex theme management beyond mode switching