flutter_themed 1.3.0
flutter_themed: ^1.3.0 copied to clipboard
Theme switching for Flutter apps. Supports light, dark, and custom themes with optional persistence.
Changelog #
1.0.0 #
- Initial version.
1.0.0+1 #
- Updated documentation.
1.0.0+2 #
- Updated documentation.
1.0.0+3 #
- Improved package description for clarity.
1.1.0 #
Added #
isDarkMode— returnstrueif the built-in dark theme is activeisLightMode— returnstrueif the built-in light theme is activeisCustomTheme— returnstrueif a custom theme is currently activeisActiveCustomTheme(String name)— returnstrueif the specified custom theme is currently active
Changed #
toggleThemenow switches to the nearest built-in theme based onBrightnesswhen a custom theme is active, instead of always defaulting to light
1.2.0 #
Added #
ThemedApp.router— named constructor that wrapsMaterialApp.router, enabling full compatibility with anyRouterConfigimplementation (go_router, auto_route, etc.)- No dependency on any routing package —
flutter_themeduses Flutter's nativeRouterConfiginterface
Changed #
- Updated FAQ:
ThemedAppnow supports bothMaterialAppandMaterialApp.router
1.3.0 #
Added #
followOsTheme({void Function(String themeName)? onThemeChanged})— starts reacting to OS brightness changes automatically, switching between 'light' and 'dark' whenever the system theme changes. Applies the current OS theme immediately on call. OptionalonThemeChangedcallback is invoked after each automatic switch with the new theme name.stopFollowingOsTheme()— stops reacting to OS brightness changes. The theme remains unchanged until manually switched.isFollowingOsTheme— returnstrueiffollowOsThemehas been called and Themed is actively reacting to OS brightness changes.ThemedApp(colorScheme:)/ThemedApp.router(colorScheme:)— optionalColorSchemeparameter that overrides the color scheme of the active theme while keeping all other theme properties intact.setDefaultDarkTheme()— convenience method, equivalent tosetTheme('dark').setDefaultLightTheme()— convenience method, equivalent tosetTheme('light').