toggleTheme function
void
toggleTheme()
Toggles the application's theme between light and dark modes.
If the current mode is ThemeMode.system, it defaults to ThemeMode.light.
Implementation
void toggleTheme() {
final ThemeMode current = _themeNotifier.value;
if (current == ThemeMode.light) {
_themeNotifier.value = ThemeMode.dark;
} else if (current == ThemeMode.dark) {
_themeNotifier.value = ThemeMode.light;
} else {
// If system, toggle to light
_themeNotifier.value = ThemeMode.light;
}
}