fixed that shit timetable bug

This commit is contained in:
Kima 2023-09-04 18:31:47 +02:00
parent da3abb7fb7
commit 467eca6c14
6 changed files with 87 additions and 56 deletions

View File

@ -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

View File

@ -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"

View File

@ -101,7 +101,7 @@ Future loginAPI({
Provider.of<UserProvider>(context, listen: false).setUser(user.id); Provider.of<UserProvider>(context, listen: false).setUser(user.id);
// Get user data // Get user data
try { // try {
await Future.wait([ await Future.wait([
Provider.of<GradeProvider>(context, listen: false).fetch(), Provider.of<GradeProvider>(context, listen: false).fetch(),
Provider.of<TimetableProvider>(context, listen: false) Provider.of<TimetableProvider>(context, listen: false)
@ -113,9 +113,9 @@ Future loginAPI({
Provider.of<EventProvider>(context, listen: false).fetch(), Provider.of<EventProvider>(context, listen: false).fetch(),
Provider.of<AbsenceProvider>(context, listen: false).fetch(), Provider.of<AbsenceProvider>(context, listen: false).fetch(),
]); ]);
} catch (error) { // } catch (error) {
print("WARNING: failed to fetch user data: $error"); // print("WARNING: failed to fetch user data: $error");
} // }
if (onSuccess != null) onSuccess(); if (onSuccess != null) onSuccess();

View File

@ -44,7 +44,8 @@ class LessonTile extends StatelessWidget {
fillLeading = true; fillLeading = true;
} }
if (lesson.substituteTeacher?.name != "") { if (lesson.substituteTeacher != null &&
lesson.substituteTeacher?.name != "") {
fill = true; fill = true;
accent = AppColors.of(context).yellow; accent = AppColors.of(context).yellow;
} }

View File

@ -61,6 +61,8 @@ class Lesson {
int get hashCode => id.hashCode; int get hashCode => id.hashCode;
factory Lesson.fromJson(Map json) { factory Lesson.fromJson(Map json) {
print(json['Allapot']);
print(json['TanarNeve']);
return Lesson( return Lesson(
id: json["Uid"] ?? "", id: json["Uid"] ?? "",
status: status:
@ -71,8 +73,9 @@ class Lesson {
subject: Subject.fromJson(json["Tantargy"] ?? {}), subject: Subject.fromJson(json["Tantargy"] ?? {}),
lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+", lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+",
lessonYearIndex: json["OraEvesSorszama"], lessonYearIndex: json["OraEvesSorszama"],
substituteTeacher: substituteTeacher: json["HelyettesTanarNeve"] != null
Teacher.fromString((json["HelyettesTanarNeve"] ?? "").trim()), ? Teacher.fromString((json["HelyettesTanarNeve"]).trim())
: null,
teacher: Teacher.fromString((json["TanarNeve"] ?? "").trim()), teacher: Teacher.fromString((json["TanarNeve"] ?? "").trim()),
homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false, homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false,
start: json["KezdetIdopont"] != null start: json["KezdetIdopont"] != null
@ -99,8 +102,7 @@ class Lesson {
online: json["IsDigitalisOra"] ?? false, online: json["IsDigitalisOra"] ?? false,
isEmpty: json['isEmpty'] ?? false, isEmpty: json['isEmpty'] ?? false,
json: json, json: json,
isSeen: false isSeen: false);
);
} }
int? getFloor() { int? getFloor() {

View File

@ -22,7 +22,8 @@ class LessonView extends StatelessWidget {
if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = "."; if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = ".";
if (lesson.substituteTeacher?.name != "") { if (lesson.substituteTeacher != null &&
lesson.substituteTeacher?.name != "") {
accent = AppColors.of(context).yellow; accent = AppColors.of(context).yellow;
} }