custom_theme_controller 0.0.2
custom_theme_controller: ^0.0.2 copied to clipboard
A custom theme controller
Features #
- It is use to switch the between light and dark theme in the app.
- Used GetX State Management tool in it.
Getting started #
- Add the dependency in the pubspec.yml
- Add the GetX dependency in the pubspec.yml
Usage #
class MyApp extends StatelessWidget {
MyApp({super.key});
final themeController = Get.put(ThemeController());
@override
Widget build(BuildContext context) {
return Obx(() => MaterialApp(
theme: themeController.isDarkMode.value ? AppTheme.darkTheme : AppTheme.lightTheme,
home: HomePage(),
)
);
}
}