updated project linter-rules and enforced them

This commit is contained in:
2024-03-29 18:22:55 +01:00
parent 21e11b6c2a
commit 75846750f7
113 changed files with 553 additions and 554 deletions

View File

@ -8,7 +8,7 @@ import '../../view/settings/defaultSettings.dart';
import 'settings.dart';
class SettingsProvider extends ChangeNotifier {
static const String _fieldName = "settings";
static const String _fieldName = 'settings';
late SharedPreferences _storage;
late Settings _settings = DefaultSettings.get();
@ -45,13 +45,13 @@ class SettingsProvider extends ChangeNotifier {
_settings = Settings.fromJson(jsonDecode(_storage.getString(_fieldName)!));
} catch(exception) {
try {
log("Settings were changed, trying to recover from old Settings: ${exception.toString()}");
log('Settings were changed, trying to recover from old Settings: ${exception.toString()}');
_settings = Settings.fromJson(_mergeSettings(jsonDecode(_storage.getString(_fieldName)!), DefaultSettings.get().toJson()));
log("Settings recovered successfully: ${_settings.toJson().toString()}");
log('Settings recovered successfully: ${_settings.toJson().toString()}');
} catch(exception) {
log("Settings are defective and not recoverable, using defaults: ${exception.toString()}");
log('Settings are defective and not recoverable, using defaults: ${exception.toString()}');
_settings = DefaultSettings.get();
log("Settings were reset to defaults!");
log('Settings were reset to defaults!');
}
}