Fix confusion in AppSettings::load()
This commit is contained in:
@@ -30,6 +30,10 @@ install-release: java gen
|
|||||||
flutter run --release -d 35221JEHN07157
|
flutter run --release -d 35221JEHN07157
|
||||||
|
|
||||||
release: java gen
|
release: java gen
|
||||||
|
@echo ""
|
||||||
|
@echo "(!) Make sure you've updated version-number in pubspec.yaml !"
|
||||||
|
@echo 'Confirmed' && read
|
||||||
|
@echo ""
|
||||||
flutter build apk --release
|
flutter build apk --release
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk "_releases/v$(VERS).apk"
|
cp build/app/outputs/flutter-apk/app-release.apk "_releases/v$(VERS).apk"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class AppSettings extends ChangeNotifier {
|
|||||||
dateFormat = AppSettingsDateFormat.ISO;
|
dateFormat = AppSettingsDateFormat.ISO;
|
||||||
messagePreviewLength = 3;
|
messagePreviewLength = 3;
|
||||||
showInfoAlerts = true;
|
showInfoAlerts = true;
|
||||||
showExtendedAttributes = true;
|
showExtendedAttributes = false;
|
||||||
|
|
||||||
notification0 = AppNotificationSettings();
|
notification0 = AppNotificationSettings();
|
||||||
notification1 = AppNotificationSettings();
|
notification1 = AppNotificationSettings();
|
||||||
@@ -102,7 +102,7 @@ class AppSettings extends ChangeNotifier {
|
|||||||
dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat;
|
dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat;
|
||||||
messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength;
|
messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength;
|
||||||
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts;
|
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts;
|
||||||
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes;
|
showExtendedAttributes = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes;
|
||||||
|
|
||||||
notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0');
|
notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0');
|
||||||
notification1 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification1');
|
notification1 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification1');
|
||||||
@@ -160,14 +160,7 @@ class AppSettings extends ChangeNotifier {
|
|||||||
|
|
||||||
class AppNotificationSettings {
|
class AppNotificationSettings {
|
||||||
// Immutable
|
// Immutable
|
||||||
AppNotificationSettings({
|
AppNotificationSettings({this.enableLights = false, this.enableVibration = true, this.playSound = true, this.sound = null, this.silent = false, this.timeoutAfter = null});
|
||||||
this.enableLights = false,
|
|
||||||
this.enableVibration = true,
|
|
||||||
this.playSound = true,
|
|
||||||
this.sound = null,
|
|
||||||
this.silent = false,
|
|
||||||
this.timeoutAfter = null,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool enableLights;
|
final bool enableLights;
|
||||||
final bool enableVibration;
|
final bool enableVibration;
|
||||||
@@ -206,14 +199,7 @@ class AppNotificationSettings {
|
|||||||
final silent = prefs.getBool('${prefix}.silent') ?? def.silent;
|
final silent = prefs.getBool('${prefix}.silent') ?? def.silent;
|
||||||
final timeoutAfter = _decode(prefs.getString('${prefix}.timeoutAfter'), def.timeoutAfter);
|
final timeoutAfter = _decode(prefs.getString('${prefix}.timeoutAfter'), def.timeoutAfter);
|
||||||
|
|
||||||
return AppNotificationSettings(
|
return AppNotificationSettings(enableLights: enableLights, enableVibration: enableVibration, playSound: playSound, sound: sound, silent: silent, timeoutAfter: timeoutAfter);
|
||||||
enableLights: enableLights,
|
|
||||||
enableVibration: enableVibration,
|
|
||||||
playSound: playSound,
|
|
||||||
sound: sound,
|
|
||||||
silent: silent,
|
|
||||||
timeoutAfter: timeoutAfter,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user