Commit 05c715c0 authored by Administrator's avatar Administrator

fix all charts

parent 61db9398
{"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-05-25 16:12:47.909129","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-05-25 18:08:52.289913","version":"1.17.1"}
\ No newline at end of file
......@@ -13,7 +13,7 @@ class Event {
Event.fromDb(this.db);
String toString() => '< Event | {$db.event} | $index >';
String toString() => '< Event | ${db.event} | $index >';
Event({
@required DataMessage dataMessage,
......
......@@ -3,6 +3,7 @@ import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/models/weight.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/activity_charts/activity_ecor_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
......@@ -21,7 +22,7 @@ class ActivityEcorWidget extends StatefulWidget {
}
class _ActivityEcorWidgetState extends State<ActivityEcorWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
Weight weight;
String weightString = "Loading ...";
......@@ -49,7 +50,7 @@ class _ActivityEcorWidgetState extends State<ActivityEcorWidget> {
padding: EdgeInsets.only(left: 25),
children: [
ActivityEcorChart(
records: ecorRecords,
records: RecordList(ecorRecords),
activity: widget.activity,
athlete: widget.athlete,
weight: weight.db.value,
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -21,7 +22,7 @@ class ActivityFormPowerWidget extends StatefulWidget {
}
class _ActivityFormPowerWidgetState extends State<ActivityFormPowerWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgFormPowerString = "Loading ...";
String sdevFormPowerString = "Loading ...";
......@@ -48,7 +49,7 @@ class _ActivityFormPowerWidgetState extends State<ActivityFormPowerWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityFormPowerChart(
records: formPowerRecords,
records: RecordList(formPowerRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -88,7 +89,7 @@ class _ActivityFormPowerWidgetState extends State<ActivityFormPowerWidget> {
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgFormPowerString = activity.db.avgFormPower.toStringOrDashes(1) + " W";
sdevFormPowerString = activity.db.sdevFormPower.toStringOrDashes(2) + " W";
setState(() {});
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -21,7 +22,7 @@ class ActivityGroundTimeWidget extends StatefulWidget {
}
class _ActivityGroundTimeWidgetState extends State<ActivityGroundTimeWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgGroundTimeString = "Loading ...";
String sdevGroundTimeString = "Loading ...";
......@@ -46,7 +47,7 @@ class _ActivityGroundTimeWidgetState extends State<ActivityGroundTimeWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityGroundTimeChart(
records: groundTimeRecords,
records: RecordList(groundTimeRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -86,7 +87,7 @@ class _ActivityGroundTimeWidgetState extends State<ActivityGroundTimeWidget> {
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgGroundTimeString = activity.db.avgGroundTime != null
? activity.db.avgGroundTime.toStringOrDashes(1) + " ms"
: "- - -";
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/models/heart_rate_zone.dart';
import 'package:encrateia/models/heart_rate_zone_schema.dart';
import 'package:encrateia/models/record_list.dart';
......@@ -22,7 +23,7 @@ class ActivityHeartRateWidget extends StatefulWidget {
}
class _ActivityHeartRateWidgetState extends State<ActivityHeartRateWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
HeartRateZoneSchema heartRateZoneSchema;
List<HeartRateZone> heartRateZones;
......@@ -47,7 +48,7 @@ class _ActivityHeartRateWidgetState extends State<ActivityHeartRateWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityHeartRateChart(
records: heartRateRecords,
records: RecordList(heartRateRecords),
activity: widget.activity,
heartRateZones: heartRateZones,
athlete: widget.athlete,
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -22,7 +23,7 @@ class ActivityLegSpringStiffnessWidget extends StatefulWidget {
class _ActivityLegSpringStiffnessWidgetState
extends State<ActivityLegSpringStiffnessWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgLegSpringStiffnessString = "Loading ...";
String sdevLegSpringStiffnessString = "Loading ...";
......@@ -48,7 +49,7 @@ class _ActivityLegSpringStiffnessWidgetState
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityLegSpringStiffnessChart(
records: legSpringStiffnessRecords,
records: RecordList(legSpringStiffnessRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -88,7 +89,7 @@ class _ActivityLegSpringStiffnessWidgetState
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgLegSpringStiffnessString =
activity.db.avgLegSpringStiffness.toStringOrDashes(1) + " ms";
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/widgets/charts/activity_charts/activity_power_per_heart_rate_chart.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
......@@ -22,7 +23,7 @@ class ActivityPowerPerHeartRateWidget extends StatefulWidget {
class _ActivityPowerPerHeartRateWidgetState
extends State<ActivityPowerPerHeartRateWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgPowerPerHeartRateString = "Loading ...";
@override
......@@ -49,7 +50,7 @@ class _ActivityPowerPerHeartRateWidgetState
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityPowerPerHeartRateChart(
records: powerPerHeartRateRecords,
records: RecordList(powerPerHeartRateRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -79,7 +80,7 @@ class _ActivityPowerPerHeartRateWidgetState
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
double avg = activity.db.avgPower / activity.db.avgHeartRate;
avgPowerPerHeartRateString = avg.toStringOrDashes(2) + " W / bpm";
setState(() {});
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -21,7 +22,7 @@ class ActivityPowerRatioWidget extends StatefulWidget {
}
class _ActivityPowerRatioWidgetState extends State<ActivityPowerRatioWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgPowerRatioString = "Loading ...";
String sdevPowerRatioString = "Loading ...";
......@@ -50,7 +51,7 @@ class _ActivityPowerRatioWidgetState extends State<ActivityPowerRatioWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityPowerRatioChart(
records: powerRecords,
records: RecordList(powerRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -91,7 +92,7 @@ class _ActivityPowerRatioWidgetState extends State<ActivityPowerRatioWidget> {
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgPowerRatioString = activity.db.avgPowerRatio.toStringOrDashes(1) + " %";
sdevPowerRatioString =
activity.db.sdevPowerRatio.toStringOrDashes(2) + " %";
......
import 'package:encrateia/utils/date_time_utils.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/power_zone.dart';
import 'package:encrateia/models/power_zone_schema.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/activity_charts/activity_power_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/utils/date_time_utils.dart';
class ActivityPowerWidget extends StatefulWidget {
final Activity activity;
......@@ -23,7 +24,7 @@ class ActivityPowerWidget extends StatefulWidget {
}
class _ActivityPowerWidgetState extends State<ActivityPowerWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgPowerString = "Loading ...";
String minPowerString = "Loading ...";
String maxPowerString = "Loading ...";
......@@ -45,14 +46,14 @@ class _ActivityPowerWidgetState extends State<ActivityPowerWidget> {
.toList();
if (powerRecords.length > 0) {
var lastRecord = powerRecords.last;
Event lastRecord = powerRecords.last;
return ListTileTheme(
iconColor: Colors.deepOrange,
child: ListView(
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityPowerChart(
records: powerRecords,
records: RecordList(powerRecords),
activity: widget.activity,
powerZones: powerZones,
athlete: widget.athlete,
......@@ -110,7 +111,7 @@ class _ActivityPowerWidgetState extends State<ActivityPowerWidget> {
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgPowerString = activity.db.avgPower.toStringOrDashes(1) + " W";
minPowerString = activity.db.minPower.toString() + " W";
maxPowerString = activity.db.maxPower.toString() + " W";
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/widgets/charts/activity_charts/activity_speed_per_heart_rate_chart.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
......@@ -22,7 +23,7 @@ class ActivitySpeedPerHeartRateWidget extends StatefulWidget {
class _ActivitySpeedPerHeartRateWidgetState
extends State<ActivitySpeedPerHeartRateWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgSpeedPerHeartRateString = "Loading ...";
@override
......@@ -48,7 +49,7 @@ class _ActivitySpeedPerHeartRateWidgetState
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivitySpeedPerHeartRateChart(
records: speedPerHeartRateRecords,
records: RecordList(speedPerHeartRateRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -78,7 +79,7 @@ class _ActivitySpeedPerHeartRateWidgetState
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
double avg = 1000 * activity.db.avgSpeed / activity.db.avgHeartRate;
avgSpeedPerHeartRateString = avg.toStringOrDashes(1) + " m/h / bpm";
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -21,7 +22,7 @@ class ActivityStrideRatioWidget extends StatefulWidget {
}
class _ActivityStrideRatioWidgetState extends State<ActivityStrideRatioWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgStrideRatioString = "Loading ...";
String sdevStrideRatioString = "Loading ...";
......@@ -48,7 +49,7 @@ class _ActivityStrideRatioWidgetState extends State<ActivityStrideRatioWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityStrideRatioChart(
records: strideRatioRecords,
records: RecordList(strideRatioRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -92,7 +93,7 @@ class _ActivityStrideRatioWidgetState extends State<ActivityStrideRatioWidget> {
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgStrideRatioString = activity.db.avgStrideRatio.toStringOrDashes(1);
sdevStrideRatioString = activity.db.sdevStrideRatio.toStringOrDashes(2);
setState(() {});
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -22,7 +23,7 @@ class ActivityStrydCadenceWidget extends StatefulWidget {
class _ActivityStrydCadenceWidgetState
extends State<ActivityStrydCadenceWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgStrydCadenceString = "Loading ...";
String sdevStrydCadenceString = "Loading ...";
......@@ -47,7 +48,7 @@ class _ActivityStrydCadenceWidgetState
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityStrydCadenceChart(
records: powerRecords,
records: RecordList(powerRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -87,7 +88,7 @@ class _ActivityStrydCadenceWidgetState
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgStrydCadenceString =
activity.db.avgStrydCadence.toStringOrDashes(1) + " spm";
sdevStrydCadenceString =
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/event.dart';
......@@ -22,7 +23,7 @@ class ActivityVerticalOscillationWidget extends StatefulWidget {
class _ActivityVerticalOscillationWidgetState
extends State<ActivityVerticalOscillationWidget> {
List<Event> records = [];
var records = RecordList(<Event>[]);
String avgVerticalOscillationString = "Loading ...";
String sdevVerticalOscillationString = "Loading ...";
......@@ -46,7 +47,7 @@ class _ActivityVerticalOscillationWidgetState
padding: EdgeInsets.only(left: 25),
children: <Widget>[
ActivityVerticalOscillationChart(
records: powerRecords,
records: RecordList(powerRecords),
activity: widget.activity,
athlete: widget.athlete,
),
......@@ -86,7 +87,7 @@ class _ActivityVerticalOscillationWidgetState
getData() async {
Activity activity = widget.activity;
records = await activity.records;
records = RecordList(await activity.records);
avgVerticalOscillationString =
activity.db.avgVerticalOscillation.toStringOrDashes(1) + " cm";
sdevVerticalOscillationString =
......
import 'package:charts_flutter/flutter.dart';
import 'package:encrateia/models/heart_rate_zone.dart';
import 'package:encrateia/models/record_list.dart';
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';
......@@ -33,6 +34,9 @@ class LapHeartRateChart extends StatelessWidget {
child: LineChart(
data,
primaryMeasureAxis: NumericAxisSpec(
viewport: MyLineChart.determineViewport(
heartRateZones: heartRateZones,
),
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: true,
......
import 'package:charts_flutter/flutter.dart';
import 'package:encrateia/models/power_zone.dart';
import 'package:encrateia/models/record_list.dart';
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';
......@@ -33,6 +34,9 @@ class LapPowerChart extends StatelessWidget {
child: LineChart(
data,
primaryMeasureAxis: NumericAxisSpec(
viewport: MyLineChart.determineViewport(
powerZones: powerZones,
),
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: true,
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/models/weight.dart';
import 'package:encrateia/models/event.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_ecor_chart.dart';
......@@ -21,7 +22,7 @@ class LapEcorWidget extends StatefulWidget {
}
class _LapEcorWidgetState extends State<LapEcorWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
Weight weight;
String weightString;
......@@ -55,7 +56,7 @@ class _LapEcorWidgetState extends State<LapEcorWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapEcorChart(
records: powerRecords,
records: RecordList(powerRecords),
weight: weight.db.value,
),
Text('${widget.athlete.db.recordAggregationCount} records are '
......
......@@ -4,6 +4,7 @@ import 'package:encrateia/models/lap.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_form_power_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/models/event.dart';
class LapFormPowerWidget extends StatefulWidget {
final Lap lap;
......@@ -15,7 +16,7 @@ class LapFormPowerWidget extends StatefulWidget {
}
class _LapFormPowerWidgetState extends State<LapFormPowerWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
String avgFormPowerString = "Loading ...";
String sdevFormPowerString = "Loading ...";
......@@ -45,7 +46,7 @@ class _LapFormPowerWidgetState extends State<LapFormPowerWidget> {
child: ListView(
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapFormPowerChart(records: records),
LapFormPowerChart(records: RecordList(formPowerRecords)),
Text('Only records where 0 W < form power < 200 W are shown.'),
Text('Swipe left/write to compare with other laps.'),
Divider(),
......
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_ground_time_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
......@@ -15,7 +16,7 @@ class LapGroundTimeWidget extends StatefulWidget {
}
class _LapGroundTimeWidgetState extends State<LapGroundTimeWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
String avgGroundTimeString = "Loading ...";
String sdevGroundTimeString = "Loading ...";
......@@ -45,7 +46,7 @@ class _LapGroundTimeWidgetState extends State<LapGroundTimeWidget> {
child: ListView(
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapGroundTimeChart(records: groundTimeRecords),
LapGroundTimeChart(records: RecordList(groundTimeRecords)),
Text('Only records where ground time > 0 ms are shown.'),
Text('Swipe left/write to compare with other laps.'),
Divider(),
......
import 'package:encrateia/models/heart_rate_zone.dart';
import 'package:encrateia/models/heart_rate_zone_schema.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/models/event.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_heart_rate_chart.dart';
......@@ -16,7 +17,7 @@ class LapHeartRateWidget extends StatefulWidget {
}
class _LapHeartRateWidgetState extends State<LapHeartRateWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
String avgHeartRateString = "Loading ...";
String sdevHeartRateString = "Loading ...";
HeartRateZoneSchema heartRateZoneSchema;
......@@ -49,7 +50,7 @@ class _LapHeartRateWidgetState extends State<LapHeartRateWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapHeartRateChart(
records: records,
records: RecordList(heartRateRecords),
heartRateZones: heartRateZones,
),
Text('Only records where heart rate > 10 bpm are shown.'),
......
......@@ -4,6 +4,7 @@ import 'package:encrateia/models/lap.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_leg_spring_stiffness_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/models/event.dart';
class LapLegSpringStiffnessWidget extends StatefulWidget {
final Lap lap;
......@@ -17,7 +18,7 @@ class LapLegSpringStiffnessWidget extends StatefulWidget {
class _LapLegSpringStiffnessWidgetState
extends State<LapLegSpringStiffnessWidget> {
var records = RecordList([]);
var records = RecordList(<Event>[]);
String avgLegSpringStiffnessString = "Loading ...";
String sdevLegSpringStiffnessString = "Loading ...";
......@@ -48,8 +49,11 @@ class _LapLegSpringStiffnessWidgetState
child: ListView(
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapLegSpringStiffnessChart(records: legSpringStiffnessRecords),
Text('Only records where leg spring stiffness > 0 kN/m are shown.'),
LapLegSpringStiffnessChart(
records: RecordList(legSpringStiffnessRecords),
),
Text(
'Only records where leg spring stiffness > 0 kN/m are shown.'),
Text('Swipe left/write to compare with other laps.'),
Divider(),
ListTile(
......
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/models/event.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/widgets/charts/power_duration_chart.dart';
......@@ -13,7 +14,7 @@ class LapPowerDurationWidget extends StatefulWidget {
}
class _LapPowerDurationWidgetState extends State<LapPowerDurationWidget> {
var records = RecordList({});
List<Event> records = [];
@override
void initState() {
......
......@@ -3,6 +3,7 @@ import 'package:encrateia/models/power_zone_schema.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_power_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
......@@ -17,7 +18,7 @@ class LapPowerWidget extends StatefulWidget {
}
class _LapPowerWidgetState extends State<LapPowerWidget> {
var records = RecordList({});
var records = RecordList(<Event>[]);
String avgPowerString = "Loading ...";
String minPowerString = "Loading ...";
String maxPowerString = "Loading ...";
......@@ -51,7 +52,7 @@ class _LapPowerWidgetState extends State<LapPowerWidget> {
padding: EdgeInsets.only(left: 25),
children: <Widget>[
LapPowerChart(
records: powerRecords,
records: RecordList(powerRecords),
powerZones: powerZones,
),
Text('Only records where power > 100 W are shown.'),
......
......@@ -4,6 +4,7 @@ import 'package:encrateia/models/lap.dart';
import 'package:encrateia/utils/num_utils.dart';
import 'package:encrateia/widgets/charts/lap_charts/lap_stryd_cadence_chart.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/models/event.dart';
class LapStrydCadenceWidget extends StatefulWidget {
final Lap lap;
......@@ -15,7 +16,7 @@ class LapStrydCadenceWidget extends StatefulWidget {