Commit 5684538f authored by Administrator's avatar Administrator

ecor on lap level not properly embedded

parent 186c8cde
......@@ -66,7 +66,10 @@ class ShowActivityScreen extends StatelessWidget {
backgroundColor: MyColor.lap,
icon: MyIcon.laps,
context: context,
nextWidget: LapsListWidget(activity: activity),
nextWidget: LapsListWidget(
activity: activity,
athlete: athlete,
),
),
navigationButton(
title: "Heart Rate",
......
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/screens/show_lap_detail_screen.dart';
import 'package:encrateia/utils/my_color.dart';
import 'package:encrateia/widgets/lap_widgets/lap_ecor_widget.dart';
import 'package:encrateia/widgets/lap_widgets/lap_metadata_widget.dart';
import 'package:encrateia/widgets/lap_widgets/lap_overview_widget.dart';
import 'package:encrateia/widgets/lap_widgets/lap_heart_rate_widget.dart';
......@@ -17,11 +19,13 @@ import 'package:encrateia/utils/icon_utils.dart';
class ShowLapScreen extends StatelessWidget {
final Lap lap;
final List<Lap> laps;
final Athlete athlete;
const ShowLapScreen({
Key key,
@required this.lap,
@required this.laps,
@required this.athlete,
}) : super(key: key);
@override
......@@ -44,7 +48,7 @@ class ShowLapScreen extends StatelessWidget {
children: [
navigationButton(
title: "Overview",
color: MyColor.navigate,
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapOverviewWidget(lap: lap),
......@@ -70,6 +74,16 @@ class ShowLapScreen extends StatelessWidget {
context: context,
nextWidget: ({lap}) => LapPowerDurationWidget(lap: lap),
),
navigationButton(
title: "Ecor",
color: MyColor.navigate,
icon: MyIcon.power,
context: context,
nextWidget: ({lap}) => LapEcorWidget(
lap: lap,
athlete: athlete,
),
),
navigationButton(
title: "Ground Time",
color: MyColor.navigate,
......@@ -107,7 +121,7 @@ class ShowLapScreen extends StatelessWidget {
),
navigationButton(
title: "Metadata",
color: MyColor.navigate,
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapMetadataWidget(lap: lap),
......
......@@ -33,7 +33,7 @@ class LapEcorChart extends StatelessWidget {
primaryMeasureAxis: NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: true,
dataIsInWholeNumbers: false,
desiredTickCount: 6),
),
animate: false,
......
......@@ -31,6 +31,12 @@ class _LapEcorWidgetState extends State<LapEcorWidget> {
super.initState();
}
@override
void didUpdateWidget(oldWidget) {
getData();
super.didUpdateWidget(oldWidget);
}
@override
Widget build(context) {
if (records.length > 0) {
......
import 'package:encrateia/models/athlete.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/lap.dart';
......@@ -7,8 +8,12 @@ import 'package:encrateia/utils/num_utils.dart';
class LapsListWidget extends StatelessWidget {
final Activity activity;
final Athlete athlete;
LapsListWidget({this.activity});
LapsListWidget({
@required this.activity,
@required this.athlete,
});
@override
Widget build(context) {
......@@ -60,6 +65,7 @@ class LapsListWidget extends StatelessWidget {
builder: (context) => ShowLapScreen(
lap: lap,
laps: laps,
athlete: athlete,
),
),
);
......
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