widget impl
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/status_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||
@@ -69,7 +71,7 @@ Future<void> syncAll(BuildContext context) {
|
||||
|
||||
Future<bool?> updateWidget() async {
|
||||
try {
|
||||
return HomeWidget.updateWidget(name: 'WidgetTimetable.widget_timetable');
|
||||
return HomeWidget.updateWidget(name: 'widget_timetable.WidgetTimetable');
|
||||
} on PlatformException catch (exception) {
|
||||
debugPrint('Error Updating Widget. $exception');
|
||||
}
|
||||
@@ -81,6 +83,6 @@ Future<void> syncAll(BuildContext context) {
|
||||
lock = false;
|
||||
|
||||
// Update Widget
|
||||
updateWidget();
|
||||
if (Platform.isAndroid) updateWidget();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ const settingsDB = DatabaseStruct("settings", {
|
||||
"x_filc_id": String, "graph_class_avg": int, "presentation_mode": int, "bell_delay": int, "bell_delay_enabled": int,
|
||||
"grade_opening_fun": int, "icon_pack": String, "premium_scopes": String, "premium_token": String, "last_account_id": String,
|
||||
});
|
||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||
// YOU'VE BEEN WARNED!!!
|
||||
const usersDB = DatabaseStruct("users", {
|
||||
"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int,
|
||||
"nickname": String // premium only
|
||||
@@ -60,7 +62,7 @@ Future<Database> initDB(DatabaseProvider database) async {
|
||||
await migrateDB(
|
||||
db,
|
||||
struct: usersDB,
|
||||
defaultValues: {"role": 0},
|
||||
defaultValues: {"role": 0, "nickname": ""},
|
||||
);
|
||||
await migrateDB(db, struct: userDataDB, defaultValues: {
|
||||
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]", "messages": "[]", "notes": "[]", "events": "[]", "absences": "[]",
|
||||
|
||||
Reference in New Issue
Block a user