diff --git a/filcnaplo/ios/Flutter/Generated 5.xcconfig b/filcnaplo/ios/Flutter/Generated 5.xcconfig new file mode 100644 index 0000000..194436b --- /dev/null +++ b/filcnaplo/ios/Flutter/Generated 5.xcconfig @@ -0,0 +1,14 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/kima/src/flutter +FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_TARGET=lib/main.dart +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=4.2.0 +FLUTTER_BUILD_NUMBER=220 +EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 +EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/filcnaplo/ios/Flutter/flutter_export_environment 5.sh b/filcnaplo/ios/Flutter/flutter_export_environment 5.sh new file mode 100755 index 0000000..276363d --- /dev/null +++ b/filcnaplo/ios/Flutter/flutter_export_environment 5.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/kima/src/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_TARGET=lib/main.dart" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=4.2.0" +export "FLUTTER_BUILD_NUMBER=220" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/filcnaplo/lib/api/login.dart b/filcnaplo/lib/api/login.dart index 4afc7ce..961eece 100644 --- a/filcnaplo/lib/api/login.dart +++ b/filcnaplo/lib/api/login.dart @@ -101,21 +101,21 @@ Future loginAPI({ Provider.of(context, listen: false).setUser(user.id); // Get user data - try { - await Future.wait([ - Provider.of(context, listen: false).fetch(), - Provider.of(context, listen: false) - .fetch(week: Week.current()), - Provider.of(context, listen: false).fetch(), - Provider.of(context, listen: false).fetch(), - Provider.of(context, listen: false).fetchAll(), - Provider.of(context, listen: false).fetch(), - Provider.of(context, listen: false).fetch(), - Provider.of(context, listen: false).fetch(), - ]); - } catch (error) { - print("WARNING: failed to fetch user data: $error"); - } + // try { + await Future.wait([ + Provider.of(context, listen: false).fetch(), + Provider.of(context, listen: false) + .fetch(week: Week.current()), + Provider.of(context, listen: false).fetch(), + Provider.of(context, listen: false).fetch(), + Provider.of(context, listen: false).fetchAll(), + Provider.of(context, listen: false).fetch(), + Provider.of(context, listen: false).fetch(), + Provider.of(context, listen: false).fetch(), + ]); + // } catch (error) { + // print("WARNING: failed to fetch user data: $error"); + // } if (onSuccess != null) onSuccess(); diff --git a/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart b/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart index 2cae242..1aeb3ef 100644 --- a/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart +++ b/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart @@ -44,7 +44,8 @@ class LessonTile extends StatelessWidget { fillLeading = true; } - if (lesson.substituteTeacher?.name != "") { + if (lesson.substituteTeacher != null && + lesson.substituteTeacher?.name != "") { fill = true; accent = AppColors.of(context).yellow; } diff --git a/filcnaplo_kreta_api/lib/models/lesson.dart b/filcnaplo_kreta_api/lib/models/lesson.dart index e232b76..db03830 100644 --- a/filcnaplo_kreta_api/lib/models/lesson.dart +++ b/filcnaplo_kreta_api/lib/models/lesson.dart @@ -61,46 +61,48 @@ class Lesson { int get hashCode => id.hashCode; factory Lesson.fromJson(Map json) { + print(json['Allapot']); + print(json['TanarNeve']); return Lesson( - id: json["Uid"] ?? "", - status: - json["Allapot"] != null ? Category.fromJson(json["Allapot"]) : null, - date: json["Datum"] != null - ? DateTime.parse(json["Datum"]).toLocal() - : DateTime(0), - subject: Subject.fromJson(json["Tantargy"] ?? {}), - lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+", - lessonYearIndex: json["OraEvesSorszama"], - substituteTeacher: - Teacher.fromString((json["HelyettesTanarNeve"] ?? "").trim()), - teacher: Teacher.fromString((json["TanarNeve"] ?? "").trim()), - homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false, - start: json["KezdetIdopont"] != null - ? DateTime.parse(json["KezdetIdopont"]).toLocal() - : DateTime(0), - studentPresence: json["TanuloJelenlet"] != null - ? (json["TanuloJelenlet"]["Nev"] ?? "") == "Hianyzas" - ? false - : true - : true, - end: json["VegIdopont"] != null - ? DateTime.parse(json["VegIdopont"]).toLocal() - : DateTime(0), - homeworkId: json["HaziFeladatUid"] ?? "", - exam: json["BejelentettSzamonkeresUid"] ?? "", - type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null, - description: json["Tema"] ?? "", - room: ((json["TeremNeve"] ?? "").split("_").join(" ") as String) - .replaceAll(RegExp(r" ?terem ?", caseSensitive: false), ""), - groupName: json["OsztalyCsoport"] != null - ? json["OsztalyCsoport"]["Nev"] ?? "" - : "", - name: json["Nev"] ?? "", - online: json["IsDigitalisOra"] ?? false, - isEmpty: json['isEmpty'] ?? false, - json: json, - isSeen: false - ); + id: json["Uid"] ?? "", + status: + json["Allapot"] != null ? Category.fromJson(json["Allapot"]) : null, + date: json["Datum"] != null + ? DateTime.parse(json["Datum"]).toLocal() + : DateTime(0), + subject: Subject.fromJson(json["Tantargy"] ?? {}), + lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+", + lessonYearIndex: json["OraEvesSorszama"], + substituteTeacher: json["HelyettesTanarNeve"] != null + ? Teacher.fromString((json["HelyettesTanarNeve"]).trim()) + : null, + teacher: Teacher.fromString((json["TanarNeve"] ?? "").trim()), + homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false, + start: json["KezdetIdopont"] != null + ? DateTime.parse(json["KezdetIdopont"]).toLocal() + : DateTime(0), + studentPresence: json["TanuloJelenlet"] != null + ? (json["TanuloJelenlet"]["Nev"] ?? "") == "Hianyzas" + ? false + : true + : true, + end: json["VegIdopont"] != null + ? DateTime.parse(json["VegIdopont"]).toLocal() + : DateTime(0), + homeworkId: json["HaziFeladatUid"] ?? "", + exam: json["BejelentettSzamonkeresUid"] ?? "", + type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null, + description: json["Tema"] ?? "", + room: ((json["TeremNeve"] ?? "").split("_").join(" ") as String) + .replaceAll(RegExp(r" ?terem ?", caseSensitive: false), ""), + groupName: json["OsztalyCsoport"] != null + ? json["OsztalyCsoport"]["Nev"] ?? "" + : "", + name: json["Nev"] ?? "", + online: json["IsDigitalisOra"] ?? false, + isEmpty: json['isEmpty'] ?? false, + json: json, + isSeen: false); } int? getFloor() { diff --git a/filcnaplo_mobile_ui/lib/common/widgets/lesson/lesson_view.dart b/filcnaplo_mobile_ui/lib/common/widgets/lesson/lesson_view.dart index dc2d560..fe5bf88 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/lesson/lesson_view.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/lesson/lesson_view.dart @@ -22,7 +22,8 @@ class LessonView extends StatelessWidget { if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = "."; - if (lesson.substituteTeacher?.name != "") { + if (lesson.substituteTeacher != null && + lesson.substituteTeacher?.name != "") { accent = AppColors.of(context).yellow; }