setTheme method
Sets the theme state based on the provided value.
isDark
: A boolean indicating whether the theme should be set to dark or not. Iftrue
, it sets the theme to dark, otherwise it sets to light.
Implementation
void setTheme(bool isDark) {
if (isDark) {
emit(const DarkDesktopTheme());
} else {
emit(const LightDesktopTheme());
}
}