Commit 117dfa55 authored by Administrator's avatar Administrator

IntervalLegSpringStiffnessWidget

parent ff261e55
{"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":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.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.5.0/","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":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.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.5.0/","dependencies":[]}],"macos":[{"name":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"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_linux","url_launcher_macos"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-09-08 16:16:53.664650","version":"1.20.3"}
\ 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":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.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.5.0/","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":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.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.5.0/","dependencies":[]}],"macos":[{"name":"package_info","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.2/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"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_linux","url_launcher_macos"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-09-08 17:10:54.825839","version":"1.20.3"}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import 'package:encrateia/screens/show_interval_detail_screen.dart';
import 'package:encrateia/utils/my_color.dart';
import 'package:encrateia/widgets/interval_widgets/interval_ground_time_widget.dart';
import 'package:encrateia/widgets/interval_widgets/interval_heart_rate_widget.dart';
import 'package:encrateia/widgets/interval_widgets/interval_leg_spring_stiffness_widget.dart';
import 'package:encrateia/widgets/interval_widgets/interval_overview_widget.dart';
import 'package:encrateia/widgets/interval_widgets/lap_power_widget.dart';
import 'package:flutter/material.dart';
......@@ -36,22 +37,22 @@ class ShowIntervalScreen extends StatelessWidget {
),
if (interval.heartRateAvailable)
navigationButton(
title: 'Heart Rate',
color: MyColor.navigate,
icon: MyIcon.heartRate,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalHeartRateWidget(interval: interval),
),
title: 'Heart Rate',
color: MyColor.navigate,
icon: MyIcon.heartRate,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalHeartRateWidget(interval: interval),
),
if (interval.powerAvailable)
navigationButton(
title: 'Power',
color: MyColor.navigate,
icon: MyIcon.power,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalPowerWidget(interval: interval),
),
title: 'Power',
color: MyColor.navigate,
icon: MyIcon.power,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalPowerWidget(interval: interval),
),
if (interval.powerAvailable)
navigationButton(
title: 'Power Duration',
......@@ -90,22 +91,22 @@ class ShowIntervalScreen extends StatelessWidget {
),
if (interval.groundTimeAvailable)
navigationButton(
title: 'Ground Time',
color: MyColor.navigate,
icon: MyIcon.groundTime,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalGroundTimeWidget(interval: interval),
),
title: 'Ground Time',
color: MyColor.navigate,
icon: MyIcon.groundTime,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalGroundTimeWidget(interval: interval),
),
if (interval.groundTimeAvailable)
navigationButton(
title: 'Leg Spring Stiffness',
color: MyColor.navigate,
icon: MyIcon.legSpringStiffness,
context: context,
nextWidget: ({encrateia.Interval interval}) => const Text(
'') // IntervalLegSpringStiffnessWidget(interval: interval),
),
title: 'Leg Spring Stiffness',
color: MyColor.navigate,
icon: MyIcon.legSpringStiffness,
context: context,
nextWidget: ({encrateia.Interval interval}) =>
IntervalLegSpringStiffnessWidget(interval: interval),
),
if (interval.formPowerAvailable)
navigationButton(
title: 'Form Power',
......
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/utils/PQText.dart';
import 'package:encrateia/utils/enums.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/interval.dart' as encrateia;
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 IntervalLegSpringStiffnessWidget extends StatefulWidget {
const IntervalLegSpringStiffnessWidget({this.interval});
final encrateia.Interval interval;
@override
_IntervalLegSpringStiffnessWidgetState createState() =>
_IntervalLegSpringStiffnessWidgetState();
}
class _IntervalLegSpringStiffnessWidgetState
extends State<IntervalLegSpringStiffnessWidget> {
RecordList<Event> records = RecordList<Event>(<Event>[]);
bool loading = true;
@override
void initState() {
getData();
super.initState();
}
@override
void didUpdateWidget(IntervalLegSpringStiffnessWidget oldWidget) {
getData();
super.didUpdateWidget(oldWidget);
}
@override
Widget build(BuildContext context) {
if (records.isNotEmpty) {
final List<Event> legSpringStiffnessRecords = records
.where((Event value) =>
value.legSpringStiffness != null && value.legSpringStiffness > 0)
.toList();
if (legSpringStiffnessRecords.isNotEmpty) {
return ListTileTheme(
iconColor: Colors.lightGreen,
child: ListView(
padding: const EdgeInsets.only(left: 25),
children: <Widget>[
LapLegSpringStiffnessChart(
records: RecordList<Event>(legSpringStiffnessRecords),
minimum: widget.interval.avgLegSpringStiffness / 1.20,
maximum: widget.interval.avgLegSpringStiffness * 1.20,
),
const Text('Only records where leg spring stiffness > 0 kN/m '
'are shown.'),
const Text('Swipe left/write to compare with other intervals.'),
const Divider(),
ListTile(
leading: MyIcon.average,
title: PQText(
value: widget.interval.avgLegSpringStiffness,
pq: PQ.legSpringStiffness,
),
subtitle: const Text('average leg spring stiffness'),
),
ListTile(
leading: MyIcon.standardDeviation,
title: PQText(
value: widget.interval.sdevLegSpringStiffness,
pq: PQ.legSpringStiffness,
),
subtitle: const Text('standard leg spring stiffness'),
),
ListTile(
leading: MyIcon.amount,
title: PQText(
value: legSpringStiffnessRecords.length,
pq: PQ.integer,
),
subtitle: const Text('number of measurements'),
),
],
),
);
} else {
return const Center(
child: Text('No leg spring stiffness data available.'),
);
}
} else {
return Center(
child: Text(loading ? 'Loading' : 'No data available'),
);
}
}
Future<void> getData() async {
records = RecordList<Event>(await widget.interval.records);
setState(() => loading = false);
}
}
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