app icon db and other things
This commit is contained in:
parent
b0eb78218a
commit
b94ed46c8a
BIN
filcnaplo/assets/launch_icons/refilc_concept.png
Normal file
BIN
filcnaplo/assets/launch_icons/refilc_concept.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 145 KiB |
BIN
filcnaplo/assets/launch_icons/refilc_overcomplicated.png
Normal file
BIN
filcnaplo/assets/launch_icons/refilc_overcomplicated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
BIN
filcnaplo/assets/launch_icons/refilc_pride.png
Normal file
BIN
filcnaplo/assets/launch_icons/refilc_pride.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
@ -34,7 +34,7 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
||||||
"renamed_teachers_italics": int,
|
"renamed_teachers_italics": int,
|
||||||
"live_activity_color": String,
|
"live_activity_color": String,
|
||||||
"welcome_message": String,
|
"welcome_message": String, "app_icon": String,
|
||||||
});
|
});
|
||||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||||
// YOU'VE BEEN WARNED!!!
|
// YOU'VE BEEN WARNED!!!
|
||||||
|
@ -79,6 +79,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _renamedTeachersItalics;
|
bool _renamedTeachersItalics;
|
||||||
Color _liveActivityColor;
|
Color _liveActivityColor;
|
||||||
String _welcomeMessage;
|
String _welcomeMessage;
|
||||||
|
String _appIcon;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@ -126,6 +127,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required bool renameTeachersItalics,
|
required bool renameTeachersItalics,
|
||||||
required Color liveActivityColor,
|
required Color liveActivityColor,
|
||||||
required String welcomeMessage,
|
required String welcomeMessage,
|
||||||
|
required String appIcon,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@ -170,7 +172,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_renamedTeachersEnabled = renameTeachersEnabled,
|
_renamedTeachersEnabled = renameTeachersEnabled,
|
||||||
_renamedTeachersItalics = renameTeachersItalics,
|
_renamedTeachersItalics = renameTeachersItalics,
|
||||||
_liveActivityColor = liveActivityColor,
|
_liveActivityColor = liveActivityColor,
|
||||||
_welcomeMessage = welcomeMessage;
|
_welcomeMessage = welcomeMessage,
|
||||||
|
_appIcon = appIcon;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@ -235,6 +238,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
||||||
liveActivityColor: Color(map["live_activity_color"]),
|
liveActivityColor: Color(map["live_activity_color"]),
|
||||||
welcomeMessage: map["welcome_message"],
|
welcomeMessage: map["welcome_message"],
|
||||||
|
appIcon: map["app_icon"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,6 +291,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
||||||
"live_activity_color": _liveActivityColor.value,
|
"live_activity_color": _liveActivityColor.value,
|
||||||
"welcome_message": _welcomeMessage,
|
"welcome_message": _welcomeMessage,
|
||||||
|
"app_icon": _appIcon,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,6 +348,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersItalics: false,
|
renameTeachersItalics: false,
|
||||||
liveActivityColor: const Color(0xFF676767),
|
liveActivityColor: const Color(0xFF676767),
|
||||||
welcomeMessage: '',
|
welcomeMessage: '',
|
||||||
|
appIcon: 'refilc_default',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,6 +400,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
||||||
Color get liveActivityColor => _liveActivityColor;
|
Color get liveActivityColor => _liveActivityColor;
|
||||||
String get welcomeMessage => _welcomeMessage;
|
String get welcomeMessage => _welcomeMessage;
|
||||||
|
String get appIcon => _appIcon;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@ -441,6 +448,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? renamedTeachersItalics,
|
bool? renamedTeachersItalics,
|
||||||
Color? liveActivityColor,
|
Color? liveActivityColor,
|
||||||
String? welcomeMessage,
|
String? welcomeMessage,
|
||||||
|
String? appIcon,
|
||||||
}) async {
|
}) async {
|
||||||
if (language != null && language != _language) _language = language;
|
if (language != null && language != _language) _language = language;
|
||||||
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
||||||
@ -568,6 +576,10 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (welcomeMessage != null && welcomeMessage != _welcomeMessage) {
|
if (welcomeMessage != null && welcomeMessage != _welcomeMessage) {
|
||||||
_welcomeMessage = welcomeMessage;
|
_welcomeMessage = welcomeMessage;
|
||||||
}
|
}
|
||||||
|
if (appIcon != null && appIcon != _appIcon) {
|
||||||
|
_appIcon = appIcon;
|
||||||
|
}
|
||||||
|
// store or not
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 10be5fafd592abe7739b8c92eb70809118589b62
|
Subproject commit a3a8c7a84dd3f2499a9d66f775cb43d06a95b6b7
|
Loading…
x
Reference in New Issue
Block a user