getThemeMode method

ThemeMode getThemeMode()

getThemeMode gets the current theme mode and returns it as a ThemeMode.

Implementation

ThemeMode getThemeMode() {
  final bool? isDark = _sharedPreferences.getBool(_isDarkKey);

  switch (isDark) {
    case true:
      return ThemeMode.dark;
    case false:
      return ThemeMode.light;
    default:
      return ThemeMode.system;
  }
}