flutter_theme_orchestrator library
A powerful Flutter theme management system with support for dynamic colors, theme scheduling, transitions, and persistence.
This library provides a comprehensive solution for managing themes in Flutter applications. Key features include:
- Dynamic theme switching with smooth transitions
- Material You/Dynamic Colors support
- Theme scheduling based on time
- Theme state persistence
- Type-safe theme configuration
Example usage:
void main() {
runApp(
ThemeOrchestrator(
child: MyApp(),
initialTheme: ThemeData.light(),
),
);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeOrchestrator.of(context).currentTheme,
darkTheme: ThemeOrchestrator.of(context).darkTheme,
themeMode: ThemeOrchestrator.of(context).themeMode,
home: MyHomePage(),
);
}
}
Classes
- ColorConverter
- A utility class for converting colors between different formats.
- InMemoryThemeStorage
- A simple in-memory implementation of ThemeStorage.
-
A ThemeStorage implementation that uses
SharedPreferencesto persist theme state. - ThemeOrchestrator
- ThemeOrchestratorState
- ThemeSchedule
- A class that represents a scheduled theme change.
- ThemeState
- ThemeStorage