1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-09-18 21:38:48 +00:00

Can toggle performances overlay

This commit is contained in:
2020-05-13 18:26:21 +02:00
parent a6ce969e89
commit 67e881af0d
4 changed files with 25 additions and 7 deletions

View File

@@ -14,12 +14,14 @@ enum PreferencesKeyList {
LOGIN_TOKENS,
ENABLE_DARK_THEME,
FORCE_MOBILE_MODE,
SHOW_PERFORMANCE_OVERLAY,
}
const _PreferenceKeysName = {
PreferencesKeyList.LOGIN_TOKENS: "login_tokens",
PreferencesKeyList.ENABLE_DARK_THEME: "dark_theme",
PreferencesKeyList.FORCE_MOBILE_MODE: "force_mobile_mode",
PreferencesKeyList.SHOW_PERFORMANCE_OVERLAY: "perfs_overlay",
};
class PreferencesHelper {
@@ -79,9 +81,10 @@ class PreferencesHelper {
/// Get all settings as an [ApplicationPreferences] object
ApplicationPreferences get preferences => ApplicationPreferences(
enableDarkMode: getBool(PreferencesKeyList.ENABLE_DARK_THEME),
forceMobileMode: getBool(PreferencesKeyList.FORCE_MOBILE_MODE),
);
enableDarkMode: getBool(PreferencesKeyList.ENABLE_DARK_THEME),
forceMobileMode: getBool(PreferencesKeyList.FORCE_MOBILE_MODE),
showPerformancesOverlay:
getBool(PreferencesKeyList.SHOW_PERFORMANCE_OVERLAY));
/// Apply new preferences
Future<void> setPreferences(ApplicationPreferences preferences) async {