changeMode method

void changeMode(
  1. ThemeMode themeMode
)

Change theme mode

Implementation

void changeMode(ThemeMode themeMode) {
  if (!allowChangeThemeMode) {
    return;
  }

  if (themeMode == ThemeMode.light) {
    setThemeMode(LIGHT);
  } else if (themeMode == ThemeMode.dark) {
    setThemeMode(DARK);
  } else if (themeMode == ThemeMode.system) {
    setThemeMode(SYSTEM);
  }

  mode.value = themeMode;
}