Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
alessioC42 committed Dec 21, 2023
2 parents 304ca9c + 5769a46 commit 9f354a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
11 changes: 6 additions & 5 deletions app/lib/client/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class SPHclient {
(status) => status != null && (status == 200 || status == 302);
try {
if (username != "" && password != "" && schoolID != "") {
FirebaseCrashlytics.instance.setCustomKey("school", client.schoolID);
final response1 = await dio.post(
"https://login.schulportal.hessen.de/?i=$schoolID",
queryParameters: {
Expand Down Expand Up @@ -562,20 +563,20 @@ class SPHclient {
() {
var schoolClasses = document.querySelectorAll("tr.printable");
for (var schoolClass in schoolClasses) {
var teacher = schoolClass.getElementsByClassName("teacher")[0];
var teacher = schoolClass.querySelector(".teacher");

result["aktuell"]?.add({
"name": schoolClass.querySelector(".name")?.text.trim(),
"teacher": {
"short": teacher
.getElementsByClassName(
?.getElementsByClassName(
"btn btn-primary dropdown-toggle btn-xs")[0]
.text.trim(),
"name": teacher.querySelector("ul>li>a>i.fa")?.parent?.text.trim()
"name": teacher?.querySelector("ul>li>a>i.fa")?.parent?.text.trim()
},
"thema": {
"title": schoolClass.getElementsByClassName("thema")[0].text.trim(),
"date": schoolClass.getElementsByClassName("datum")[0].text.trim()
"title": schoolClass.querySelector(".thema")?.text.trim(),
"date": schoolClass.querySelector(".datum")?.text.trim()
},
"data": {
"entry": schoolClass.attributes["data-entry"],
Expand Down
5 changes: 1 addition & 4 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ class _HomePageState extends State<HomePage> {
statusController.add(Status.loadUserData);
await client.loadFromStorage();

FirebaseCrashlytics.instance.setCustomKey("school", client.schoolID);


await client.prepareDio();

statusController.add(Status.login);
Expand Down Expand Up @@ -313,7 +310,7 @@ class _HomePageState extends State<HomePage> {
setState(() {
isLoading = false;
});

client.prepareFetchers();
openFeature(Feature.substitutions);
});
}
Expand Down
14 changes: 7 additions & 7 deletions app/lib/view/mein_unterricht/mein_unterricht.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _MeinUnterrichtAnsichtState extends State<MeinUnterrichtAnsicht>
left: padding, right: padding, bottom: padding),
child: Card(
child: ListTile(
title: Text(presence[index]["Kurs"]),
title: Text(presence[index]["Kurs"] ?? ""),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: rowChildren,
Expand Down Expand Up @@ -113,8 +113,8 @@ class _MeinUnterrichtAnsichtState extends State<MeinUnterrichtAnsicht>
left: padding, right: padding, bottom: padding),
child: Card(
child: ListTile(
title: Text(courses[index]["title"]),
subtitle: Text(courses[index]["teacher"]),
title: Text(courses[index]["title"] ?? ""),
subtitle: Text(courses[index]["teacher"] ?? ""),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
Expand Down Expand Up @@ -149,19 +149,19 @@ class _MeinUnterrichtAnsichtState extends State<MeinUnterrichtAnsicht>
left: padding, right: padding, bottom: padding),
child: Card(
child: ListTile(
title: Text(current[index]["name"]),
title: Text(current[index]["name"] ?? ""),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Thema: ${current[index]["thema"]["title"]}"),
"Thema: ${current[index]["thema"]["title"] ?? ""}"),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"${current[index]["teacher"]["short"]}-${current[index]["teacher"]["name"]}"),
Text(current[index]["thema"]["date"])
"${current[index]["teacher"]["short"] ?? "-"}-${current[index]["teacher"]["name"]??"-"}"),
Text(current[index]["thema"]["date"]??"-")
],
),
],
Expand Down

0 comments on commit 9f354a2

Please sign in to comment.