mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Create ApplicationPreferences object
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:comunic/models/application_preferences.dart';
|
||||
import 'package:comunic/models/login_tokens.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@ -70,6 +71,12 @@ class PreferencesHelper {
|
||||
final v = _sharedPreferences.getBool(_PreferenceKeysName[key]);
|
||||
return v == null ? alternative : v;
|
||||
}
|
||||
|
||||
/// Get all settings as an [ApplicationPreferences] object
|
||||
ApplicationPreferences get preferences => ApplicationPreferences(
|
||||
enableDarkMode:
|
||||
getBool(PreferencesKeyList.ENABLE_DARK_THEME, alternative: null),
|
||||
);
|
||||
}
|
||||
|
||||
PreferencesHelper preferences() {
|
||||
|
Reference in New Issue
Block a user