|
|
@ -45,7 +45,15 @@ enum AppSettings<T> {
|
|
|
|
audioRecordingEchoCancel<bool>('audioRecordingEchoCancel', false),
|
|
|
|
audioRecordingEchoCancel<bool>('audioRecordingEchoCancel', false),
|
|
|
|
audioRecordingNoiseSuppress<bool>('audioRecordingNoiseSuppress', true),
|
|
|
|
audioRecordingNoiseSuppress<bool>('audioRecordingNoiseSuppress', true),
|
|
|
|
audioRecordingBitRate<int>('audioRecordingBitRate', 64000),
|
|
|
|
audioRecordingBitRate<int>('audioRecordingBitRate', 64000),
|
|
|
|
audioRecordingSamplingRate<int>('audioRecordingSamplingRate', 44100);
|
|
|
|
audioRecordingSamplingRate<int>('audioRecordingSamplingRate', 44100),
|
|
|
|
|
|
|
|
pushNotificationsGatewayUrl<String>(
|
|
|
|
|
|
|
|
'pushNotificationsGatewayUrl',
|
|
|
|
|
|
|
|
'https://push.fluffychat.im/_matrix/push/v1/notify',
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
pushNotificationsPusherFormat<String>(
|
|
|
|
|
|
|
|
'pushNotificationsPusherFormat',
|
|
|
|
|
|
|
|
'event_id_only',
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final String key;
|
|
|
|
final String key;
|
|
|
|
final T defaultValue;
|
|
|
|
final T defaultValue;
|
|
|
@ -55,6 +63,7 @@ enum AppSettings<T> {
|
|
|
|
|
|
|
|
|
|
|
|
extension AppSettingsBoolExtension on AppSettings<bool> {
|
|
|
|
extension AppSettingsBoolExtension on AppSettings<bool> {
|
|
|
|
bool getItem(SharedPreferences store) => store.getBool(key) ?? defaultValue;
|
|
|
|
bool getItem(SharedPreferences store) => store.getBool(key) ?? defaultValue;
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> setItem(SharedPreferences store, bool value) =>
|
|
|
|
Future<void> setItem(SharedPreferences store, bool value) =>
|
|
|
|
store.setBool(key, value);
|
|
|
|
store.setBool(key, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -62,12 +71,14 @@ extension AppSettingsBoolExtension on AppSettings<bool> {
|
|
|
|
extension AppSettingsStringExtension on AppSettings<String> {
|
|
|
|
extension AppSettingsStringExtension on AppSettings<String> {
|
|
|
|
String getItem(SharedPreferences store) =>
|
|
|
|
String getItem(SharedPreferences store) =>
|
|
|
|
store.getString(key) ?? defaultValue;
|
|
|
|
store.getString(key) ?? defaultValue;
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> setItem(SharedPreferences store, String value) =>
|
|
|
|
Future<void> setItem(SharedPreferences store, String value) =>
|
|
|
|
store.setString(key, value);
|
|
|
|
store.setString(key, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extension AppSettingsIntExtension on AppSettings<int> {
|
|
|
|
extension AppSettingsIntExtension on AppSettings<int> {
|
|
|
|
int getItem(SharedPreferences store) => store.getInt(key) ?? defaultValue;
|
|
|
|
int getItem(SharedPreferences store) => store.getInt(key) ?? defaultValue;
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> setItem(SharedPreferences store, int value) =>
|
|
|
|
Future<void> setItem(SharedPreferences store, int value) =>
|
|
|
|
store.setInt(key, value);
|
|
|
|
store.setInt(key, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -75,6 +86,7 @@ extension AppSettingsIntExtension on AppSettings<int> {
|
|
|
|
extension AppSettingsDoubleExtension on AppSettings<double> {
|
|
|
|
extension AppSettingsDoubleExtension on AppSettings<double> {
|
|
|
|
double getItem(SharedPreferences store) =>
|
|
|
|
double getItem(SharedPreferences store) =>
|
|
|
|
store.getDouble(key) ?? defaultValue;
|
|
|
|
store.getDouble(key) ?? defaultValue;
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> setItem(SharedPreferences store, double value) =>
|
|
|
|
Future<void> setItem(SharedPreferences store, double value) =>
|
|
|
|
store.setDouble(key, value);
|
|
|
|
store.setDouble(key, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|