changed everything from filcnaplo to refilc finally

This commit is contained in:
Kima
2024-02-24 20:12:25 +01:00
parent 0d1c7b7143
commit 1171e3aaaf
655 changed files with 38728 additions and 44967 deletions

View File

@@ -0,0 +1,54 @@
import 'package:refilc_kreta_api/models/subject.dart';
import 'category.dart';
import 'teacher.dart';
class Exam {
Map? json;
DateTime date;
DateTime writeDate;
Category? mode;
// int? subjectIndex;
// String subjectName;
GradeSubject subject;
Teacher teacher;
String description;
String group;
String id;
Exam({
required this.id,
required this.date,
required this.writeDate,
this.mode,
// this.subjectIndex,
// required this.subjectName,
required this.subject,
required this.teacher,
required this.description,
required this.group,
this.json,
});
factory Exam.fromJson(Map json) {
return Exam(
id: json["Uid"] ?? "",
date: json["BejelentesDatuma"] != null
? DateTime.parse(json["BejelentesDatuma"]).toLocal()
: DateTime(0),
writeDate: json["Datum"] != null
? DateTime.parse(json["Datum"]).toLocal()
: DateTime(0),
mode: json["Modja"] != null ? Category.fromJson(json["Modja"]) : null,
// subjectIndex: json["OrarendiOraOraszama"],
// subjectName: json["TantargyNeve"] ?? "",
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
description: (json["Temaja"] ?? "").trim(),
group: json["OsztalyCsoport"] != null
? json["OsztalyCsoport"]["Uid"] ?? ""
: "",
json: json,
);
}
}