Commit 6407f37a authored by Stefan Haslinger's avatar Stefan Haslinger

switch to physical quantities, alignment of rows

parent 87a7b1e6
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/","dependencies":[]}],"macos":[{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"shared_preferences_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"url_launcher_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/daten/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-08-18 12:18:21.465260","version":"1.20.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":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.0/","dependencies":[]}],"macos":[{"name":"package_info","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.1/","dependencies":[]},{"name":"path_provider_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]},{"name":"shared_preferences_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.1/","dependencies":[]},{"name":"url_launcher_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+7/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"shared_preferences_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1/","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+1/","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/daten/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-08-18 13:15:56.280863","version":"1.20.1"}
\ No newline at end of file
......@@ -100,6 +100,10 @@ class PQText extends StatelessWidget {
return value != null && value != -1;
case PQ.heartRate:
return value != null && value != 255;
case PQ.stanceTime:
return value != null && value != 6553.50;
case PQ.percentage:
return value != null && value != 655.35;
default:
return value != null;
}
......
......@@ -69,21 +69,22 @@ class ActivityMetadataWidget extends StatelessWidget {
subtitle: const Text('total timer time'),
),
ListTile(
title: Row(children: <Widget>[
PQText(value: activity.stravaId, pq: PQ.integer),
const Text(' / '),
PQText(value: activity.serialNumber, pq: PQ.integer),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.stravaId, pq: PQ.integer),
PQText(value: activity.serialNumber, pq: PQ.integer),
]),
subtitle: const Text('Strava / Garmin id'),
),
ListTile(
title: Row(children: <Widget>[
PQText(value: activity.type, pq: PQ.text),
const Text(' / '),
PQText(value: activity.sport, pq: PQ.text),
const Text(' / '),
PQText(value: activity.subSport, pq: PQ.text),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.type, pq: PQ.text),
PQText(value: activity.sport, pq: PQ.text),
PQText(value: activity.subSport, pq: PQ.text),
]),
subtitle: const Text('activity type / sport / sub sport'),
),
ListTile(
......@@ -125,32 +126,39 @@ class ActivityMetadataWidget extends StatelessWidget {
subtitle: const Text('avg stance time / avg stance time percent'),
),
ListTile(
title: Column(children: <Widget>[
PQText(value: activity.startPositionLong, pq: PQ.longitude),
PQText(value: activity.startPositionLat, pq: PQ.latitude),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.startPositionLong, pq: PQ.longitude),
PQText(value: activity.startPositionLat, pq: PQ.latitude),
]),
subtitle: const Text('start position'),
),
ListTile(
title: Column(children: <Widget>[
PQText(value: activity.necLong, pq: PQ.longitude),
PQText(value: activity.necLat, pq: PQ.latitude),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.necLong, pq: PQ.longitude),
PQText(value: activity.necLat, pq: PQ.latitude),
]),
subtitle: const Text('north east corner'),
),
ListTile(
title: Column(children: <Widget>[
PQText(value: activity.swcLong, pq: PQ.longitude),
PQText(value: activity.swcLat, pq: PQ.latitude),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.swcLong, pq: PQ.longitude),
PQText(value: activity.swcLat, pq: PQ.latitude),
]),
subtitle: const Text('south west corner'),
),
ListTile(
title: Row(children: <Widget>[
PQText(value: activity.avgSpeed, pq: PQ.speed),
const Text(' / '),
PQText(value: activity.maxSpeed, pq: PQ.speed),
]),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: activity.avgSpeed, pq: PQ.speed),
PQText(value: activity.maxSpeed, pq: PQ.speed),
]),
subtitle: const Text('avg / max speed'),
),
];
......
......@@ -83,9 +83,9 @@ class _ActivityOverviewWidgetState extends State<ActivityOverviewWidget> {
),
ListTile(
title: Row(children: <Widget>[
PQText(value: widget.activity.totalAscent, pq: PQ.elevation),
PQText(value: widget.activity.totalAscent, pq: PQ.integer),
const Text(' - '),
PQText(value: widget.activity.totalDescent, pq: PQ.elevation),
PQText(value: widget.activity.totalDescent, pq: PQ.integer),
const Text(' = '),
PQText(value: widget.activity.elevationDifference, pq: PQ.elevation),
]),
......
import 'package:encrateia/utils/PQText.dart';
import 'package:encrateia/utils/enums.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/utils/date_time_utils.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:intl/intl.dart';
import 'package:encrateia/models/lap.dart';
......@@ -12,80 +13,109 @@ class LapMetadataWidget extends StatelessWidget {
List<Widget> get tiles {
return <Widget>[
ListTile(
title:
Text(DateFormat('dd MMM yyyy, h:mm:ss').format(lap.timeStamp)),
title: PQText(value: lap.timeStamp, pq: PQ.dateTime),
subtitle: const Text('timestamp'),
),
ListTile(
title: Text(lap.event),
title: PQText(value: lap.event, pq: PQ.text),
subtitle: const Text('event'),
),
ListTile(
title: Text(lap.sport + ' / ' + lap.subSport),
title: Row(children: <Widget>[
PQText(value: lap.sport, pq: PQ.text),
const Text(' / '),
PQText(value: lap.subSport, pq: PQ.text),
]),
subtitle: const Text('sport / sub sport'),
),
ListTile(
title: Text(lap.eventType + ' / ' + lap.eventGroup.toString()),
title: Row(children: <Widget>[
PQText(value: lap.eventType, pq: PQ.text),
const Text(' / '),
PQText(value: lap.eventGroup, pq: PQ.integer),
]),
subtitle: const Text('event type / group'),
),
ListTile(
title: Text(lap.avgVerticalOscillation.toStringAsFixed(2)),
title: PQText(
value: lap.avgVerticalOscillation, pq: PQ.verticalOscillation),
subtitle: const Text('avg vertical oscillation'),
),
ListTile(
title: Text(Duration(seconds: lap.totalElapsedTime).asString()),
title: PQText(value: lap.totalElapsedTime, pq: PQ.duration),
subtitle: const Text('total elapsed time'),
),
ListTile(
title: Text(Duration(seconds: lap.totalTimerTime).asString()),
title: PQText(value: lap.totalTimerTime, pq: PQ.duration),
subtitle: const Text('total timer time'),
),
ListTile(
title: Text(
'${lap.avgStanceTime} ms / ${lap.avgStanceTimePercent} %'),
title: Row(children: <Widget>[
PQText(value: lap.avgStanceTime, pq: PQ.stanceTime),
const Text(' / '),
PQText(value: lap.avgStanceTimePercent, pq: PQ.percentage),
]),
subtitle: const Text('avg stance time / avg stance time percent'),
),
ListTile(
title: Text(lap.lapTrigger),
title: PQText(value: lap.lapTrigger, pq: PQ.text),
subtitle: const Text('lap trigger'),
),
ListTile(
title: Text('${lap.avgTemperature}° / ${lap.maxTemperature}°'),
title: Row(children: <Widget>[
PQText(value: lap.avgTemperature, pq: PQ.temperature),
const Text(' / '),
PQText(value: lap.maxTemperature, pq: PQ.temperature),
]),
subtitle: const Text('avg / max temperature'),
),
ListTile(
title: Text(lap.avgFractionalCadence.toStringAsFixed(2) +
' / ' +
lap.maxFractionalCadence.toStringAsFixed(2)),
title: Row(children: <Widget>[
PQText(
value: lap.avgFractionalCadence,
pq: PQ.fractionalCadence,
),
const Text(' / '),
PQText(
value: lap.maxFractionalCadence,
pq: PQ.fractionalCadence,
),
]),
subtitle: const Text('avg / max fractional cadence'),
),
ListTile(
title: Text(lap.totalFractionalCycles.toStringAsFixed(2)),
title: PQText(value: lap.totalFractionalCycles, pq: PQ.cycles),
subtitle: const Text('total fractional cycles'),
),
ListTile(
title: Text(lap.startPositionLong.semicirclesAsDegrees() +
' E\n' +
lap.startPositionLat.semicirclesAsDegrees() +
' N'),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: lap.startPositionLong, pq: PQ.longitude),
PQText(value: lap.startPositionLat, pq: PQ.latitude),
]),
subtitle: const Text('start position'),
),
ListTile(
title: Text(lap.endPositionLong.semicirclesAsDegrees() +
' E\n' +
lap.endPositionLat.semicirclesAsDegrees() +
' N'),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: lap.endPositionLong, pq: PQ.longitude),
PQText(value: lap.endPositionLat, pq: PQ.latitude),
]),
subtitle: const Text('end position'),
),
ListTile(
title: Text(lap.intensity.toString()),
title: PQText(value: lap.intensity, pq: PQ.integer),
subtitle: const Text('intensity'),
),
ListTile(
title: Text((lap.avgSpeed * 3.6).toStringAsFixed(2) +
' km/h / ' +
(lap.maxSpeed * 3.6).toStringAsFixed(2) +
' km/h'),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PQText(value: lap.avgSpeed, pq: PQ.speed),
PQText(value: lap.maxSpeed, pq: PQ.speed),
]),
subtitle: const Text('avg / max speed'),
),
];
......
......@@ -67,9 +67,9 @@ class _LapOverviewWidgetState extends State<LapOverviewWidget> {
),
ListTile(
title: Row(children: <Widget>[
PQText(value: widget.lap.totalAscent, pq: PQ.elevation),
PQText(value: widget.lap.totalAscent, pq: PQ.integer),
const Text(' - '),
PQText(value: widget.lap.totalDescent, pq: PQ.elevation),
PQText(value: widget.lap.totalDescent, pq: PQ.integer),
const Text(' = '),
PQText(value: widget.lap.elevationDifference, pq: PQ.elevation),
]),
......
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