custom_theme_controller 0.0.2 copy "custom_theme_controller: ^0.0.2" to clipboard
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(),
    )
    );
  }
}
1
likes
130
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A custom theme controller

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, get

More

Packages that depend on custom_theme_controller