From b4d9432c53836d2c5549545a295611a00a5b81ab Mon Sep 17 00:00:00 2001 From: Username * Date: Sat, 23 Dec 2023 13:30:22 +0100 Subject: [PATCH 1/3] remove change-db workflow --- .github/workflows/build-change-db.yml | 57 --------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/build-change-db.yml diff --git a/.github/workflows/build-change-db.yml b/.github/workflows/build-change-db.yml deleted file mode 100644 index 213c9a2..0000000 --- a/.github/workflows/build-change-db.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Android Build and Artifact - -on: - push: - branches: - - change-db -jobs: - build: - name: Android Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: "11" - distribution: "zulu" - cache: 'gradle' - - uses: subosito/flutter-action@v2 - with: - channel: "stable" - cache: true - - name: Set up Flutter - run: flutter pub get - - name: Build with Flutter - env: - SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} - SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} - SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} - run: flutter build apk --release --split-per-abi - - name: Sign APK - id: sign_apk - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: build/app/outputs/flutter-apk/ - signingKeyBase64: ${{ secrets.SIGNING_KEYSTORE }} - keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} - alias: ${{ secrets.SIGNING_KEY_ALIAS }} - keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} - - name: Archive arm64-v8a - uses: actions/upload-artifact@v2 - with: - name: android-arm64-v8a - path: | - build/app/outputs/flutter-apk/*-arm64-v8a-release-signed.apk - - name: Archive armeabi-v7a - uses: actions/upload-artifact@v2 - with: - name: android-armeabi-v7a - path: | - build/app/outputs/flutter-apk/*-armeabi-v7a-release-signed.apk - - name: Archive x86_64 - uses: actions/upload-artifact@v2 - with: - name: android-x86_64 - path: | - build/app/outputs/flutter-apk/*-x86_64-release-signed.apk From 5e80b358a9d9a9bd5e34000b3c9fa914f84f8926 Mon Sep 17 00:00:00 2001 From: Username * Date: Sat, 23 Dec 2023 13:30:42 +0100 Subject: [PATCH 2/3] refix overlapping subjects not deleting properly --- lib/db/models.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/db/models.dart b/lib/db/models.dart index 8c02d17..545d14b 100644 --- a/lib/db/models.dart +++ b/lib/db/models.dart @@ -4,6 +4,7 @@ import 'package:timetable/constants/days.dart'; import 'package:timetable/constants/rotation_weeks.dart'; import 'package:timetable/db/converters/time_of_day_converter.dart'; import 'package:timetable/db/database.dart'; +import 'package:timetable/models/overlapping_subjects.dart'; class Subject extends Table { IntColumn get id => integer().autoIncrement()(); @@ -19,8 +20,12 @@ class Subject extends Table { class SubjNotifier extends StateNotifier> { AppDatabase db; + List> overlappingSubjects; - SubjNotifier(this.db) : super([]) { + SubjNotifier( + this.db, + this.overlappingSubjects, + ) : super([]) { getSubjects(); } @@ -55,6 +60,7 @@ class SubjNotifier extends StateNotifier> { Future deleteSubject(SubjectData entry) async { db.subject.deleteWhere((t) => t.id.equals(entry.id)); + overlappingSubjects.removeWhere((e) => e.contains(entry)); state = await getSubjects(); } @@ -67,5 +73,6 @@ class SubjNotifier extends StateNotifier> { } final subjProvider = StateNotifierProvider>( - (ref) => SubjNotifier(ref.watch(AppDatabase.provider)), + (ref) => SubjNotifier( + ref.watch(AppDatabase.provider), ref.watch(overlappingSubjectsProvider)), ); From 0ed94128a66836d56589208c13511d442c9735f3 Mon Sep 17 00:00:00 2001 From: Username * Date: Sat, 23 Dec 2023 13:35:38 +0100 Subject: [PATCH 3/3] improve color auto complete and remove experimental subtitle under rotation weeks in the settings --- lib/components/settings/timetable_features.dart | 6 ++++-- lib/components/subject_management/subject_screen.dart | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/components/settings/timetable_features.dart b/lib/components/settings/timetable_features.dart index eaf1428..b846624 100644 --- a/lib/components/settings/timetable_features.dart +++ b/lib/components/settings/timetable_features.dart @@ -31,14 +31,16 @@ class TimetableFeaturesOptions extends ConsumerWidget { ), SwitchListTile( title: const Text("Rotation Weeks"), - subtitle: const Text("Experimental"), value: rotationWeeks, onChanged: (bool value) { settings.updateRotationWeeks(value); }, ), SwitchListTile( - title: const Text("AutoComplete Colors"), + title: const Text("Auto Complete Colors"), + subtitle: const Text( + "auto assigns colors from previously made subjects that have matching names", + ), value: autoCompleteColor, onChanged: (bool value) { settings.updateAutoCompleteColor(value); diff --git a/lib/components/subject_management/subject_screen.dart b/lib/components/subject_management/subject_screen.dart index 7d492a1..8db8597 100644 --- a/lib/components/subject_management/subject_screen.dart +++ b/lib/components/subject_management/subject_screen.dart @@ -202,8 +202,8 @@ class SubjectScreen extends HookConsumerWidget { color.value = Color(subjects .firstWhere( (subj) => - label.value.toLowerCase() == - subj.label.toLowerCase(), + label.value.toLowerCase().trim() == + subj.label.toLowerCase().trim(), orElse: () => basicSubject, ) .color);