setTheme method

void setTheme(
  1. bool isDark
)

Sets the theme state based on the provided value.

  • isDark: A boolean indicating whether the theme should be set to dark or not. If true, 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());
  }
}