0 purchases
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(),
)
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.