flutter_dynamic_theme_engine
A dynamic multi-theme palette engine for Flutter. Generates accessible light and dark Material 3 themes on the fly from user seed colors with HSL color math and smooth animated transitions.
🌟 Key Features
- 🎨 HSL Material Color Generator: Programmatically generates 10-shade Material Color swatches from any seed hex color.
- ♿ WCAG 2.1 Contrast Checker: Utility to check text-on-background contrast compliance.
- 🌓 Dynamic Theme Builder: Reactive widget wrapper animating theme switches smoothly across the widget tree.
📦 Installation
Add flutter_dynamic_theme_engine to your pubspec.yaml:
dependencies:
flutter_dynamic_theme_engine: ^1.0.0
🚀 Quick Start
final themeNotifier = DynamicThemeNotifier();
// In main.dart
DynamicThemeBuilder(
notifier: themeNotifier,
builder: (context, lightTheme, darkTheme, themeMode) {
return MaterialApp(
theme: lightTheme,
darkTheme: darkTheme,
themeMode: themeMode,
home: const HomeScreen(),
);
},
);
// Switch seed color dynamically anywhere
themeNotifier.setSeedColor(Colors.teal);
📄 License
MIT License - Developed with ❤️ by Olamilekan Adeyemi (@lekthedeveloper).