From 6e06d82b1a799994de713f062b42aceae105d6ec Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 3 Sep 2023 21:17:22 +0200 Subject: [PATCH 1/5] made goal planner modal dark mode compatible --- filcnaplo/ios/Flutter/Generated 4.xcconfig | 15 ++++++++++++ .../goal_planner/goal_complete_modal.dart | 23 +++++++++++-------- 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 filcnaplo/ios/Flutter/Generated 4.xcconfig diff --git a/filcnaplo/ios/Flutter/Generated 4.xcconfig b/filcnaplo/ios/Flutter/Generated 4.xcconfig new file mode 100644 index 0000000..394c5b3 --- /dev/null +++ b/filcnaplo/ios/Flutter/Generated 4.xcconfig @@ -0,0 +1,15 @@ +// 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=/Users/kima/Documents/refilc/app/naplo/filcnaplo/lib/main.dart +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=4.1.1 +FLUTTER_BUILD_NUMBER=216 +EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 +EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 +DART_DEFINES=QVBQVkVSPTQuMS4x,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJlZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw== +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=/Users/kima/Documents/refilc/app/naplo/filcnaplo/.dart_tool/package_config.json diff --git a/filcnaplo_premium/lib/ui/mobile/goal_planner/goal_complete_modal.dart b/filcnaplo_premium/lib/ui/mobile/goal_planner/goal_complete_modal.dart index 01c6610..0b2d9c1 100644 --- a/filcnaplo_premium/lib/ui/mobile/goal_planner/goal_complete_modal.dart +++ b/filcnaplo_premium/lib/ui/mobile/goal_planner/goal_complete_modal.dart @@ -1,5 +1,6 @@ import 'package:filcnaplo/api/providers/database_provider.dart'; import 'package:filcnaplo/api/providers/user_provider.dart'; +import 'package:filcnaplo/theme/colors/colors.dart'; import 'package:filcnaplo_kreta_api/models/subject.dart'; import 'package:filcnaplo_mobile_ui/common/average_display.dart'; import 'package:filcnaplo_premium/ui/mobile/goal_planner/goal_state_screen.i18n.dart'; @@ -33,7 +34,7 @@ class GoalCompleteModal extends StatelessWidget { child: Container( padding: const EdgeInsets.all(16.0), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).colorScheme.background, borderRadius: BorderRadius.circular(20.0), ), child: Column( @@ -79,19 +80,21 @@ class GoalCompleteModal extends StatelessWidget { Text( 'congrats_title'.i18n, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( fontSize: 27.0, fontWeight: FontWeight.w700, - height: 1.1, + height: 1.2, + color: AppColors.of(context).text, ), ), Text( 'goal_reached'.i18n.fill(['20']), textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.w500, height: 1.1, + color: AppColors.of(context).text, ), ), const SizedBox(height: 18.0), @@ -103,9 +106,10 @@ class GoalCompleteModal extends StatelessWidget { Text( 'started_at'.i18n, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( fontSize: 17.0, fontWeight: FontWeight.w500, + color: AppColors.of(context).text, ), ), const SizedBox(width: 5.0), @@ -119,9 +123,10 @@ class GoalCompleteModal extends StatelessWidget { averageDifference.toStringAsFixed(2) + '%', ]), textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( fontSize: 17.0, fontWeight: FontWeight.w500, + color: AppColors.of(context).text, ), ), ], @@ -173,17 +178,17 @@ class GoalCompleteModal extends StatelessWidget { width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.0), - color: const Color(0xFFF5FAF9), + color: const Color.fromARGB(38, 131, 131, 131), ), child: Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( 'later'.i18n, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w700, - color: Color(0xFF01342D), + color: AppColors.of(context).text, ), ), ), From 5e650869f2fc01c7aa547d759f63749d6b4a14fb Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 3 Sep 2023 22:13:39 +0200 Subject: [PATCH 2/5] added some hint for spaces after username --- .../Flutter/flutter_export_environment 3.sh | 13 ++++ filcnaplo/lib/api/login.dart | 12 ++-- .../lib/screens/login/login_screen.dart | 6 +- .../lib/screens/login/login_screen.dart | 64 +++++++++++++------ .../lib/screens/login/login_screen.i18n.dart | 6 +- 5 files changed, 69 insertions(+), 32 deletions(-) create mode 100755 filcnaplo/ios/Flutter/flutter_export_environment 3.sh diff --git a/filcnaplo/ios/Flutter/flutter_export_environment 3.sh b/filcnaplo/ios/Flutter/flutter_export_environment 3.sh new file mode 100755 index 0000000..276363d --- /dev/null +++ b/filcnaplo/ios/Flutter/flutter_export_environment 3.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 c17bf08..4afc7ce 100644 --- a/filcnaplo/lib/api/login.dart +++ b/filcnaplo/lib/api/login.dart @@ -27,7 +27,7 @@ enum LoginState { failed, normal, inProgress, - success + success, } Nonce getNonce(String nonce, String username, String instituteCode) { @@ -39,7 +39,7 @@ Nonce getNonce(String nonce, String username, String instituteCode) { return nonceEncoder; } -Future loginApi({ +Future loginAPI({ required String username, required String password, required String instituteCode, @@ -49,14 +49,14 @@ Future loginApi({ }) async { Provider.of(context, listen: false).userAgent = Provider.of(context, listen: false).config.userAgent; - + Map headers = { "content-type": "application/x-www-form-urlencoded", }; - + String nonceStr = await Provider.of(context, listen: false) .getAPI(KretaAPI.nonce, json: false); - + Nonce nonce = getNonce(nonceStr, username, instituteCode); headers.addAll(nonce.header()); @@ -121,7 +121,7 @@ Future loginApi({ return LoginState.success; } catch (error) { - print("ERROR: loginApi: $error"); + print("ERROR: loginAPI: $error"); // maybe check debug mode // ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("ERROR: $error"))); return LoginState.failed; diff --git a/filcnaplo_desktop_ui/lib/screens/login/login_screen.dart b/filcnaplo_desktop_ui/lib/screens/login/login_screen.dart index ec6736f..a206d61 100644 --- a/filcnaplo_desktop_ui/lib/screens/login/login_screen.dart +++ b/filcnaplo_desktop_ui/lib/screens/login/login_screen.dart @@ -235,7 +235,7 @@ class _LoginScreenState extends State { fontWeight: FontWeight.w600, fontSize: 15.0, )), - onPressed: () => _loginApi(context: context), + onPressed: () => _loginAPI(context: context), ), visible: _loginState != LoginState.inProgress, replacement: const Padding( @@ -279,7 +279,7 @@ class _LoginScreenState extends State { ); } - void _loginApi({required BuildContext context}) { + void _loginAPI({required BuildContext context}) { String username = usernameController.text; String password = passwordController.text; @@ -289,7 +289,7 @@ class _LoginScreenState extends State { setState(() => _loginState = LoginState.inProgress); - loginApi( + loginAPI( username: username, password: password, instituteCode: schoolController.selectedSchool!.instituteCode, diff --git a/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart b/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart index 34bf31c..fef6f0a 100755 --- a/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart +++ b/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart @@ -1,3 +1,4 @@ +// import 'dart:async'; import 'dart:ui'; import 'package:filcnaplo/api/client.dart'; @@ -42,6 +43,8 @@ class _LoginScreenState extends State { stops: [-1.0, 0.0, 1.0], ); + late String tempUsername = ''; + @override void initState() { super.initState(); @@ -250,7 +253,7 @@ class _LoginScreenState extends State { fontWeight: FontWeight.w600, fontSize: 15.0, )), - onPressed: () => _loginApi(context: context), + onPressed: () => _loginAPI(context: context), ), visible: _loginState != LoginState.inProgress, replacement: const Padding( @@ -288,35 +291,54 @@ class _LoginScreenState extends State { ); } - void _loginApi({required BuildContext context}) { + void _loginAPI({required BuildContext context}) { String username = usernameController.text; String password = passwordController.text; + tempUsername = username; + if (username == "" || password == "" || schoolController.selectedSchool == null) { return setState(() => _loginState = LoginState.missingFields); } - setState(() => _loginState = LoginState.inProgress); + void _callAPI() { + loginAPI( + username: username, + password: password, + instituteCode: schoolController.selectedSchool!.instituteCode, + context: context, + onLogin: (user) { + ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( + context: context, + brightness: Brightness.light, + content: Text("welcome".i18n.fill([user.name]), + overflow: TextOverflow.ellipsis), + )); + }, + onSuccess: () { + ScaffoldMessenger.of(context).hideCurrentSnackBar(); + setSystemChrome(context); + Navigator.of(context).pushReplacementNamed("login_to_navigation"); + }).then( + (res) => setState(() { + // if (res == LoginState.invalidGrant && + // tempUsername.replaceAll(username, '').length <= 3) { + // tempUsername = username + ' '; + // Timer( + // const Duration(milliseconds: 500), + // () => _loginAPI(context: context), + // ); + // // _loginAPI(context: context); + // } else { + _loginState = res; + // } + }), + ); + } - loginApi( - username: username, - password: password, - instituteCode: schoolController.selectedSchool!.instituteCode, - context: context, - onLogin: (user) { - ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( - context: context, - brightness: Brightness.light, - content: Text("welcome".i18n.fill([user.name]), - overflow: TextOverflow.ellipsis), - )); - }, - onSuccess: () { - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - setSystemChrome(context); - Navigator.of(context).pushReplacementNamed("login_to_navigation"); - }).then((res) => setState(() => _loginState = res)); + setState(() => _loginState = LoginState.inProgress); + _callAPI(); } } diff --git a/filcnaplo_mobile_ui/lib/screens/login/login_screen.i18n.dart b/filcnaplo_mobile_ui/lib/screens/login/login_screen.i18n.dart index bcbeace..6e24d7c 100755 --- a/filcnaplo_mobile_ui/lib/screens/login/login_screen.i18n.dart +++ b/filcnaplo_mobile_ui/lib/screens/login/login_screen.i18n.dart @@ -12,7 +12,8 @@ extension Localization on String { "login": "Log in", "welcome": "Welcome, %s!", "missing_fields": "Missing Fields!", - "invalid_grant": "Invalid Username/Password!", + "invalid_grant": + "Invalid Username/Password! (Try adding spaces after Username)", "error": "Failed to log in.", "schools_error": "Failed to get schools." }, @@ -25,7 +26,8 @@ extension Localization on String { "login": "Belépés", "welcome": "Üdv, %s!", "missing_fields": "Hiányzó adatok!", - "invalid_grant": "Helytelen Felhasználónév/Jelszó!", + "invalid_grant": + "Helytelen Felhasználónév/Jelszó! (Próbálj szóközöket írni a Felhasználónév után)", "error": "Sikertelen bejelentkezés.", "schools_error": "Nem sikerült lekérni az iskolákat." }, From da3abb7fb7d6c47decdfaa55a76656cefcb121a3 Mon Sep 17 00:00:00 2001 From: Kima Date: Mon, 4 Sep 2023 17:10:09 +0200 Subject: [PATCH 3/5] fixed school select (omfg nagyon szarul csinaltak) --- .gitignore | 1 + .../lib/screens/login/login_screen.dart | 5 +- .../login/school_input/school_input_tile.dart | 79 +++++++++---------- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 2e80ede..7f38ad2 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ filcnaplo/ios/Podfile.lock key.properties .flutter-plugins* +filcnaplo/ios/Flutter/flutter_export_environment 4.sh diff --git a/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart b/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart index fef6f0a..22b1c5c 100755 --- a/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart +++ b/filcnaplo_mobile_ui/lib/screens/login/login_screen.dart @@ -278,7 +278,10 @@ class _LoginScreenState extends State { ][_loginState.index] .i18n, style: const TextStyle( - color: Colors.red, fontWeight: FontWeight.w500), + color: Colors.red, + fontWeight: FontWeight.w500, + ), + textAlign: TextAlign.center, ), ), const Spacer() diff --git a/filcnaplo_mobile_ui/lib/screens/login/school_input/school_input_tile.dart b/filcnaplo_mobile_ui/lib/screens/login/school_input/school_input_tile.dart index ae48d26..a364c23 100755 --- a/filcnaplo_mobile_ui/lib/screens/login/school_input/school_input_tile.dart +++ b/filcnaplo_mobile_ui/lib/screens/login/school_input/school_input_tile.dart @@ -12,51 +12,48 @@ class SchoolInputTile extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(4.0), - child: GestureDetector( - onPanDown: (e) { + child: InkWell( + onTap: () { onTap!(); }, - child: InkWell( - onTapDown: (e) {}, - borderRadius: BorderRadius.circular(6.0), - child: Padding( - padding: const EdgeInsets.all(6.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // School name - Padding( - padding: const EdgeInsets.only(bottom: 4.0), - child: Text( - school.name, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: const TextStyle(fontWeight: FontWeight.w600), + borderRadius: BorderRadius.circular(6.0), + child: Padding( + padding: const EdgeInsets.all(6.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // School name + Padding( + padding: const EdgeInsets.only(bottom: 4.0), + child: Text( + school.name, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: const TextStyle(fontWeight: FontWeight.w600), + ), + ), + Row( + children: [ + // School id + Expanded( + child: Text( + school.instituteCode, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), - ), - Row( - children: [ - // School id - Expanded( - child: Text( - school.instituteCode, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), + // School city + Expanded( + child: Text( + school.city, + textAlign: TextAlign.right, + maxLines: 1, + overflow: TextOverflow.ellipsis, ), - // School city - Expanded( - child: Text( - school.city, - textAlign: TextAlign.right, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), ), From 467eca6c14d2ada6b97b931542f92218c20c8f69 Mon Sep 17 00:00:00 2001 From: Kima Date: Mon, 4 Sep 2023 18:31:47 +0200 Subject: [PATCH 4/5] fixed that shit timetable bug --- filcnaplo/ios/Flutter/Generated 5.xcconfig | 14 ++++ .../Flutter/flutter_export_environment 5.sh | 13 +++ filcnaplo/lib/api/login.dart | 30 +++---- .../lib/ui/widgets/lesson/lesson_tile.dart | 3 +- filcnaplo_kreta_api/lib/models/lesson.dart | 80 ++++++++++--------- .../common/widgets/lesson/lesson_view.dart | 3 +- 6 files changed, 87 insertions(+), 56 deletions(-) create mode 100644 filcnaplo/ios/Flutter/Generated 5.xcconfig create mode 100755 filcnaplo/ios/Flutter/flutter_export_environment 5.sh 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; } From 1bdc1409e4c0e2cc269d4a0beeba3b078bd0281b Mon Sep 17 00:00:00 2001 From: Kima Date: Mon, 4 Sep 2023 18:33:24 +0200 Subject: [PATCH 5/5] updated version number --- filcnaplo/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filcnaplo/pubspec.yaml b/filcnaplo/pubspec.yaml index 5ee5c56..3fa9e11 100644 --- a/filcnaplo/pubspec.yaml +++ b/filcnaplo/pubspec.yaml @@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez" homepage: https://refilc.hu publish_to: "none" -version: 4.2.0+220 +version: 4.2.1+221 environment: sdk: ">=2.17.0 <3.0.0"