Closed ABINASH56 closed 5 years ago
You could do this:
Checkbox(
value: DynamicTheme.of(context).brightness == Brightness.light,
onChanged: (bool isLight) => DynamicTheme.of(context).setBrightness(isLight? Brightness.light : Brightness.dark),
);
Maybe Norbert515 has a better solution 😋
Norbert is not replying to anyone.Thank you for your help. Your answer was helpful
Sorry for my absence - @Khaoz-Topsy answer is great. Additionally, a PR just landed which makes toggling the brightness easier.
I want to enable light/dark mode through switch/checkbox instead of button ..How can I achieve this? Please help