Commit 0b60de2c authored by Administrator's avatar Administrator

pace instead of speed

parent b842805c
......@@ -30,4 +30,17 @@ extension DegreeFormatters on double {
return "no value";
}
}
String toPace() {
if (this != null) {
var totalSeconds = 1000 / this;
var minutes = (totalSeconds / 60).floor();
var seconds = (totalSeconds - minutes * 60).round();
return "${minutes}min ${seconds}s";
} else {
return "no value";
}
}
}
......@@ -129,6 +129,15 @@ class ActivityMetadataWidget extends StatelessWidget {
activity.db.swcLat.semicirclesAsDegrees()),
subtitle: Text('south west corner'),
),
ListTile(
leading: Icon(Icons.shutter_speed),
title: Text((activity.db.avgSpeed * 3.6).toStringAsFixed(2) +
" km/h / " +
(activity.db.maxSpeed * 3.6).toStringAsFixed(2) +
" km/h"),
subtitle: Text('avg / max speed'),
),
],
),
);
......
......@@ -34,11 +34,10 @@ class ActivityOverviewWidget extends StatelessWidget {
),
ListTile(
leading: Icon(Icons.shutter_speed),
title: Text((activity.db.avgSpeed * 3.6).toStringAsFixed(2) +
" km/h / " +
(activity.db.maxSpeed * 3.6).toStringAsFixed(2) +
" km/h"),
subtitle: Text('avg / max speed'),
title: Text(activity.db.avgSpeed.toPace() +
" / " +
activity.db.maxSpeed.toPace()),
subtitle: Text('avg / max pace'),
),
ListTile(
leading: Icon(Icons.battery_charging_full),
......
......@@ -104,6 +104,14 @@ class LapMetadataWidget extends StatelessWidget {
title: Text(lap.db.intensity.toString()),
subtitle: Text('intensity'),
),
ListTile(
leading: Icon(Icons.shutter_speed),
title: Text((lap.db.avgSpeed * 3.6).toStringAsFixed(2) +
" km/h / " +
(lap.db.maxSpeed * 3.6).toStringAsFixed(2) +
" km/h"),
subtitle: Text('avg / max speed'),
),
],
),
);
......
......@@ -24,16 +24,13 @@ class LapOverviewWidget extends StatelessWidget {
ListTile(
leading: Icon(Icons.redo),
title:
Text('${(lap.db.totalDistance / 1000).toStringAsFixed(2)} km'),
Text('${(lap.db.totalDistance / 1000).toStringAsFixed(2)} km'),
subtitle: Text('distance'),
),
ListTile(
leading: Icon(Icons.shutter_speed),
title: Text((lap.db.avgSpeed * 3.6).toStringAsFixed(2) +
" km/h / " +
(lap.db.maxSpeed * 3.6).toStringAsFixed(2) +
" km/h"),
subtitle: Text('avg / max speed'),
title: Text(lap.db.avgSpeed.toPace() + " / " + lap.db.maxSpeed.toPace()),
subtitle: Text('avg / max pace'),
),
ListTile(
leading: Icon(Icons.battery_charging_full),
......@@ -48,7 +45,8 @@ class LapOverviewWidget extends StatelessWidget {
),
ListTile(
leading: Icon(Icons.spa),
title: Text("${lap.db.avgHeartRate} bpm / ${lap.db.maxHeartRate} bpm"),
title:
Text("${lap.db.avgHeartRate} bpm / ${lap.db.maxHeartRate} bpm"),
subtitle: Text('avg / max heart rate'),
),
ListTile(
......
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