Commit 631b2b2e authored by Administrator's avatar Administrator

charts with area below (I see the overshoot...)

parent cf9ad462
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-06-09 17:00:39.441210","version":"1.17.1"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-06-10 07:52:49.207150","version":"1.17.1"}
\ No newline at end of file
......@@ -5,10 +5,7 @@ import 'package:encrateia/models/lap.dart';
import 'package:encrateia/models/power_zone.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:flutter/foundation.dart';
import 'package:charts_common/common.dart' as common
show
Series,
ChartBehavior;
import 'package:charts_common/common.dart' as common show Series, ChartBehavior;
class MyLineChart extends LineChart {
MyLineChart({
......@@ -23,6 +20,9 @@ class MyLineChart extends LineChart {
NumericTickProviderSpec domainTickProviderSpec,
}) : super(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
domainAxis: NumericAxisSpec(
viewport: NumericExtents(0, maxDomain + 500),
tickProviderSpec: domainTickProviderSpec,
......@@ -69,24 +69,20 @@ class MyLineChart extends LineChart {
return NumericExtents(
powerZones
.map((PowerZone powerZone) => powerZone.lowerLimit)
.reduce(min) -
5.0,
.reduce(min) * 0.9,
powerZones
.map((PowerZone powerZone) => powerZone.upperLimit)
.reduce(max) +
5.0);
.reduce(max) * 1.1);
else if (heartRateZones != null)
return NumericExtents(
heartRateZones
.map((HeartRateZone heartRateZone) =>
heartRateZone.lowerLimit)
.reduce(min) -
5.0,
.map(
(HeartRateZone heartRateZone) => heartRateZone.lowerLimit)
.reduce(min) * 0.9,
heartRateZones
.map((HeartRateZone heartRateZone) =>
heartRateZone.upperLimit)
.reduce(max) +
5.0);
.map(
(HeartRateZone heartRateZone) => heartRateZone.upperLimit)
.reduce(max) * 1.1);
else
return null;
}
......
......@@ -35,7 +35,7 @@ class ActivityEcorChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Ecor',
colorFn: (_, __) => MaterialPalette.gray.shade700,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -31,7 +31,7 @@ class ActivityFormPowerChart extends StatelessWidget {
final List<Series<IntPlotPoint, int>> data = <Series<IntPlotPoint, int>>[
Series<IntPlotPoint, int>(
id: 'Form power',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (IntPlotPoint record, _) => record.domain,
measureFn: (IntPlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -31,7 +31,7 @@ class ActivityGroundTimeChart extends StatelessWidget {
final List<Series<DoublePlotPoint, int>> data = <Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Ground Time',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -34,7 +34,7 @@ class ActivityHeartRateChart extends StatelessWidget {
final List<Series<IntPlotPoint, int>> data = <Series<IntPlotPoint, int>>[
Series<IntPlotPoint, int>(
id: 'Heart Rate',
colorFn: (_, __) => MaterialPalette.red.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (IntPlotPoint point, _) => point.domain,
measureFn: (IntPlotPoint point, _) => point.measure,
data: smoothedRecords,
......
......@@ -32,7 +32,7 @@ class ActivityLegSpringStiffnessChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Leg spring stiffness',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -34,7 +34,7 @@ class ActivityPowerChart extends StatelessWidget {
final List<Series<IntPlotPoint, int>> data = <Series<IntPlotPoint, int>>[
Series<IntPlotPoint, int>(
id: 'Power',
colorFn: (_, __) => MaterialPalette.gray.shade700,
colorFn: (_, __) => Color.black,
domainFn: (IntPlotPoint record, _) => record.domain,
measureFn: (IntPlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -32,7 +32,7 @@ class ActivityPowerPerHeartRateChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Power per Heart Rate',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -32,7 +32,7 @@ class ActivityPowerRatioChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Power Ratio',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -31,7 +31,7 @@ class ActivitySpeedPerHeartRateChart extends StatelessWidget {
final List<Series<DoublePlotPoint, int>> data = <Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Speed per Heart Rate',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -32,7 +32,7 @@ class ActivityStrideRatioChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Stride Ratio',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -31,7 +31,7 @@ class ActivityStrydCadenceChart extends StatelessWidget {
final List<Series<DoublePlotPoint, int>> data = <Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Cadence',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -32,7 +32,7 @@ class ActivityVerticalOscillationChart extends StatelessWidget {
<Series<DoublePlotPoint, int>>[
Series<DoublePlotPoint, int>(
id: 'Vertical Oscillation',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (DoublePlotPoint record, _) => record.domain,
measureFn: (DoublePlotPoint record, _) => record.measure,
data: smoothedRecords,
......
......@@ -19,7 +19,7 @@ class LapEcorChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Ecor',
colorFn: (_, __) => MaterialPalette.gray.shade700,
colorFn: (_, __) => MaterialPalette.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) =>
record.power / record.speed / weight,
......@@ -31,6 +31,9 @@ class LapEcorChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -16,7 +16,7 @@ class LapFormPowerChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Form Power',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.formPower,
data: records,
......@@ -27,6 +27,9 @@ class LapFormPowerChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -16,7 +16,7 @@ class LapGroundTimeChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Ground Time',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.groundTime,
data: records,
......@@ -27,7 +27,9 @@ class LapGroundTimeChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
animate: false,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -26,7 +26,7 @@ class LapHeartRateChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Heart Rate',
colorFn: (_, __) => MaterialPalette.red.shadeDefault,
colorFn: (_, __) => MaterialPalette.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.heartRate,
data: records,
......@@ -37,6 +37,9 @@ class LapHeartRateChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: NumericAxisSpec(
viewport: MyLineChart.determineViewport(
heartRateZones: heartRateZones,
......
......@@ -16,7 +16,7 @@ class LapLegSpringStiffnessChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Leg Spring Stiffness',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.groundTime,
data: records,
......@@ -28,6 +28,9 @@ class LapLegSpringStiffnessChart extends StatelessWidget {
child: LineChart(
data,
animate: false,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -5,10 +5,7 @@ import 'package:encrateia/utils/my_line_chart.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/graph_utils.dart';
import 'package:charts_common/common.dart' as common
show
ChartBehavior;
import 'package:charts_common/common.dart' as common show ChartBehavior;
class LapPowerChart extends StatelessWidget {
const LapPowerChart({
......@@ -26,7 +23,7 @@ class LapPowerChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Power',
colorFn: (_, __) => MaterialPalette.gray.shade700,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.power,
data: records,
......@@ -37,6 +34,9 @@ class LapPowerChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: NumericAxisSpec(
viewport: MyLineChart.determineViewport(
powerZones: powerZones,
......
......@@ -16,7 +16,7 @@ class LapStrydCadenceChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Stryd Cadence',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => 2 * record.strydCadence,
data: records,
......@@ -27,7 +27,9 @@ class LapStrydCadenceChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
animate: false,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -16,7 +16,7 @@ class LapVerticalOscillationChart extends StatelessWidget {
final List<Series<Event, int>> data = <Series<Event, int>>[
Series<Event, int>(
id: 'Vertical Oscillation',
colorFn: (_, __) => MaterialPalette.green.shadeDefault,
colorFn: (_, __) => Color.black,
domainFn: (Event record, _) => record.distance.round() - offset,
measureFn: (Event record, _) => record.verticalOscillation,
data: records,
......@@ -27,7 +27,9 @@ class LapVerticalOscillationChart extends StatelessWidget {
height: 300,
child: LineChart(
data,
animate: false,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -52,6 +52,9 @@ class PowerDurationChart extends StatelessWidget {
padding: const EdgeInsets.all(2),
child: LineChart(
data,
defaultRenderer: LineRendererConfig<num>(
includeArea: true,
),
primaryMeasureAxis: const NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
......
......@@ -18,6 +18,7 @@ class LapGroundTimeWidget extends StatefulWidget {
class _LapGroundTimeWidgetState extends State<LapGroundTimeWidget> {
RecordList<Event> records = RecordList<Event>(<Event>[]);
String sdevGroundTimeString = 'Loading ...';
String avgGroundTimeString = 'Loading ...';
@override
void initState() {
......@@ -51,7 +52,7 @@ class _LapGroundTimeWidgetState extends State<LapGroundTimeWidget> {
const Divider(),
ListTile(
leading: MyIcon.average,
title: Text(widget.lap.avgGroundTime.toStringOrDashes(1) + ' ms'),
title: Text(avgGroundTimeString),
subtitle: const Text('average ground time'),
),
ListTile(
......@@ -82,7 +83,7 @@ class _LapGroundTimeWidgetState extends State<LapGroundTimeWidget> {
Future<void> getData() async {
final Lap lap = widget.lap;
records = RecordList<Event>(await lap.records);
avgGroundTimeString = widget.lap.avgGroundTime.toStringOrDashes(1) + ' ms';
setState(() {
sdevGroundTimeString = lap.sdevGroundTime.toStringOrDashes(2) + ' ms';
});
......
......@@ -20,6 +20,7 @@ class _LapLegSpringStiffnessWidgetState
extends State<LapLegSpringStiffnessWidget> {
RecordList<Event> records = RecordList<Event>(<Event>[]);
String sdevLegSpringStiffnessString = 'Loading ...';
String avgLegSpringStiffnessString = 'Loading ...';
@override
void initState() {
......@@ -50,15 +51,13 @@ class _LapLegSpringStiffnessWidgetState
LapLegSpringStiffnessChart(
records: RecordList<Event>(legSpringStiffnessRecords),
),
const Text(
'Only records where leg spring stiffness > 0 kN/m are shown.'),
const Text('Only records where leg spring stiffness > 0 kN/m '
'are shown.'),
const Text('Swipe left/write to compare with other laps.'),
const Divider(),
ListTile(
leading: MyIcon.average,
title: Text(
widget.lap.avgLegSpringStiffness.toStringOrDashes(1) +
' ms'),
title: Text(avgLegSpringStiffnessString),
subtitle: const Text('average ground time'),
),
ListTile(
......@@ -90,6 +89,8 @@ class _LapLegSpringStiffnessWidgetState
final Lap lap = widget.lap;
records = RecordList<Event>(await lap.records);
setState(() {
avgLegSpringStiffnessString =
widget.lap.avgLegSpringStiffness.toStringOrDashes(1) + ' ms';
sdevLegSpringStiffnessString =
lap.sdevLegSpringStiffness.toStringOrDashes(2) + ' ms';
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment