|
|
|
|
@ -137,8 +137,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
});
|
|
|
|
|
generateWeekData();
|
|
|
|
|
setState(() {
|
|
|
|
|
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
|
|
|
|
|
weeklyStatsAvgValue = weeklyStatsAvgValue / 1000;
|
|
|
|
|
if (avgWeeklyStepsValue != 0) {
|
|
|
|
|
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
|
|
|
|
|
weeklyStatsAvgValue = weeklyStatsAvgValue / 1000;
|
|
|
|
|
}
|
|
|
|
|
isWeeklyDataLoaded = true;
|
|
|
|
|
});
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -165,8 +167,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
});
|
|
|
|
|
generateMonthData();
|
|
|
|
|
setState(() {
|
|
|
|
|
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
|
|
|
|
|
monthlyStatsAvgValue = monthlyStatsAvgValue / 1000;
|
|
|
|
|
if (avgMonthlyStepsValue != 0) {
|
|
|
|
|
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
|
|
|
|
|
monthlyStatsAvgValue = monthlyStatsAvgValue / 1000;
|
|
|
|
|
}
|
|
|
|
|
isMonthlyDataLoaded = true;
|
|
|
|
|
});
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -193,8 +197,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
});
|
|
|
|
|
generateYearData();
|
|
|
|
|
setState(() {
|
|
|
|
|
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
|
|
|
|
|
yearlyStatsAvgValue = yearlyStatsAvgValue / 1000;
|
|
|
|
|
if (avgYearlyStepsValue != 0) {
|
|
|
|
|
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
|
|
|
|
|
yearlyStatsAvgValue = yearlyStatsAvgValue / 1000;
|
|
|
|
|
}
|
|
|
|
|
isYearlyDataLoaded = true;
|
|
|
|
|
});
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -457,16 +463,16 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
yearlyStepsList.isEmpty
|
|
|
|
|
? Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(TranslationBase.of(context).noDataAvailable),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(TranslationBase.of(context).noDataAvailable),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Table(
|
|
|
|
|
columnWidths: {
|
|
|
|
|
0: FlexColumnWidth(2.5),
|
|
|
|
|
},
|
|
|
|
|
children: fullData(context),
|
|
|
|
|
),
|
|
|
|
|
columnWidths: {
|
|
|
|
|
0: FlexColumnWidth(2.5),
|
|
|
|
|
},
|
|
|
|
|
children: fullData(context),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
@ -549,7 +555,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
yearlyStepsList.forEach(
|
|
|
|
|
(step) {
|
|
|
|
|
(step) {
|
|
|
|
|
tableRow.add(
|
|
|
|
|
TableRow(
|
|
|
|
|
children: [
|
|
|
|
|
@ -559,7 +565,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
)} ',
|
|
|
|
|
isCapitable: false,
|
|
|
|
|
mProjectViewModel: projectViewModel),
|
|
|
|
|
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_ , isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
|
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_,
|
|
|
|
|
isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -567,5 +574,4 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
|
|
|
|
|
);
|
|
|
|
|
return tableRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|