fix some random issues

This commit is contained in:
Jonas Braus
2024-11-29 02:21:25 +01:00
parent eb4206ea4b
commit 103c768c3b
3 changed files with 9 additions and 18 deletions
+6 -15
View File
@@ -15,7 +15,7 @@ class BuilderTodayAverage {
child: RatingCard(
rating1: q1,
rating2: q2,
title: ratingNames[page]["title"] + (essen == -1 ? "" : ": $essen"),
title: ratingNames[page]["title"] + (essen == -1 ? "" : "$essen"),
rating1Title: ratingNames[page]["q1"],
rating2Title: ratingNames[page]["q2"],
text: "",
@@ -47,12 +47,7 @@ class BuilderTodayAverage {
var ratings = map["ratings"];
ratings["page1"]["food"] = ratings["page1"]["food"]
.toString()
.toLowerCase()
.replaceAll("ä", "ae")
.replaceAll("ö", "oe")
.replaceAll("ü", "ue")
.replaceAll("ß", "ss");
.toString();
print(ratings["page1"]["food"]);
@@ -79,8 +74,6 @@ class BuilderTodayAverage {
avgP3[2] += page3["q1"] == 0 ? 0 : 1;
}
print(foodMap[1]);
for (var i in [1, 2, 3]) {
foodMap[i]?[0] =
(foodMap[i]![0] / (foodMap[i]![2] == 0 ? 1 : foodMap[i]![2])).toInt();
@@ -88,12 +81,10 @@ class BuilderTodayAverage {
(foodMap[i]![1] / (foodMap[i]![2] == 0 ? 1 : foodMap[i]![2])).toInt();
}
print(foodMap[1]);
avgP2[0] = (avgP2[0] / avgP2[2]).toInt();
avgP2[1] = (avgP2[1] / avgP2[2]).toInt();
avgP3[0] = (avgP3[0] / avgP3[2]).toInt();
avgP3[1] = (avgP3[1] / avgP3[2]).toInt();
avgP2[0] = (avgP2[0] / avgP2[2] == 0 ? 1 : avgP2[2]).toInt();
avgP2[1] = (avgP2[1] / avgP2[2] == 0 ? 1 : avgP2[2]).toInt();
avgP3[0] = (avgP3[0] / avgP3[2] == 0 ? 1 : avgP3[2]).toInt();
avgP3[1] = (avgP3[1] / avgP3[2] == 0 ? 1 : avgP3[2]).toInt();
return SingleChildScrollView(
child: Center(