Skip to content

Commit

Permalink
Minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshbalu committed Jun 25, 2020
1 parent f64a4e1 commit 2ae49cd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ class _BloodPressureTrackerScreenState
totalSystolic += s.systolic;
totalPulse += s.pulse;
}
averageDiastolic = totalDiastolic / list.length;
averageSystolic = totalSystolic / list.length;
averagePulse = totalPulse / list.length;
setState(() {
averageDiastolic = totalDiastolic / list.length;
averageSystolic = totalSystolic / list.length;
averagePulse = totalPulse / list.length;
});

return snapshot;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class _BloodSugarTrackerScreenState extends State<BloodSugarTrackerScreen> {
for (var s in list) {
totalValue += s.bloodSugar;
}
averageValue = totalValue / list.length;
setState(() {
averageValue = totalValue / list.length;
});

return snapshot;
}

Expand Down
5 changes: 4 additions & 1 deletion lib/screens/trackers/sleep/sleep_tracker_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class _SleepTrackerScreenState extends State<SleepTrackerScreen> {
for (var s in list) {
totalSleep += s.hours + s.minutes / 60;
}
averageSleep = totalSleep / list.length;
setState(() {
averageSleep = totalSleep / list.length;
});

return snapshot;
}

Expand Down
5 changes: 4 additions & 1 deletion lib/screens/trackers/weight/weight_tracker_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class _WeightTrackerScreenState extends State<WeightTrackerScreen> {
for (var s in list) {
totalWeight += s.weight;
}
averageWeight = totalWeight / list.length;
setState(() {
averageWeight = totalWeight / list.length;
});

return snapshot;
}

Expand Down

0 comments on commit 2ae49cd

Please sign in to comment.