From 92e2baacaa215839197deb889fac9c526d3510fe Mon Sep 17 00:00:00 2001 From: Username * Date: Fri, 22 Dec 2023 22:31:17 +0100 Subject: [PATCH] feat: change database from hive to drift --- android/app/src/main/AndroidManifest.xml | 1 + lib/components/settings/timetable_data.dart | 4 +- .../subject_management/subject_screen.dart | 35 +- lib/components/timetable_views/day_view.dart | 9 +- lib/components/timetable_views/grid_view.dart | 11 +- .../widgets/day_view_subject_builder.dart | 13 +- ...rid_view_overlapping_subjects_builder.dart | 15 +- .../widgets/grid_view_subject_builder.dart | 6 +- lib/constants/basic_subject.dart | 11 +- lib/constants/rotation_weeks.dart | 8 +- lib/db/connection/native.dart | 24 + lib/db/converters/color_converter.dart | 18 + lib/db/converters/time_of_day_converter.dart | 21 + lib/db/database.dart | 25 + lib/db/database.g.dart | 456 ++++++++++++++++++ lib/db/models.dart | 71 +++ lib/main.dart | 8 +- lib/models/days.g.dart | 17 - lib/models/overlapping_subjects.dart | 6 +- lib/models/rotationWeeks.g.dart | 17 - lib/models/subjects.dart | 131 ----- lib/models/subjects.g.dart | 56 --- lib/models/timeOfDay.g.dart | 25 - lib/screens/timetable_screen.dart | 5 + pubspec.lock | 156 +++--- pubspec.yaml | 14 +- 26 files changed, 793 insertions(+), 370 deletions(-) create mode 100644 lib/db/connection/native.dart create mode 100644 lib/db/converters/color_converter.dart create mode 100644 lib/db/converters/time_of_day_converter.dart create mode 100644 lib/db/database.dart create mode 100644 lib/db/database.g.dart create mode 100644 lib/db/models.dart delete mode 100644 lib/models/days.g.dart delete mode 100644 lib/models/rotationWeeks.g.dart delete mode 100644 lib/models/subjects.dart delete mode 100644 lib/models/subjects.g.dart delete mode 100644 lib/models/timeOfDay.g.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d0c1af4..8dbb2ae 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,6 +10,7 @@ android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" + android:enableOnBackInvokedCallback="true" android:windowSoftInputMode="adjustResize">