diff --git a/lib/entities/preferences_key.dart b/lib/entities/preferences_key.dart index f9bf224f8..c2d6427c9 100644 --- a/lib/entities/preferences_key.dart +++ b/lib/entities/preferences_key.dart @@ -10,6 +10,7 @@ class PreferencesKey { static const allowBiometricalAuthenticationKey = 'allow_biometrical_authentication'; static const currentTheme = 'current_theme'; + static const isDarkThemeLegacy = 'dark_theme'; static const displayActionListModeKey = 'display_list_mode'; static const currentPinLength = 'current_pin_length'; static const currentLanguageCode = 'language_code'; diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index db9efd8d8..30cf4f238 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -66,8 +66,8 @@ abstract class SettingsStoreBase with Store { reaction( (_) => currentTheme, - (ThemeBase theme) => sharedPreferences.setInt( - PreferencesKey.currentTheme, theme.raw)); + (ThemeBase theme) => + sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw)); reaction( (_) => allowBiometricalAuthentication, @@ -152,8 +152,14 @@ abstract class SettingsStoreBase with Store { final allowBiometricalAuthentication = sharedPreferences .getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? false; + final legacyTheme = + sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) + ? ThemeType.dark.index + : ThemeType.bright.index; final savedTheme = ThemeList.deserialize( - raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? 0); + raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? + legacyTheme ?? + 0); final actionListDisplayMode = ObservableList(); actionListDisplayMode.addAll(deserializeActionlistDisplayModes( sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ??