Commit 8322bc79 authored by Administrator's avatar Administrator

instroducing staggered grid to show screens

parent 14e4d8e3
{"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-26 13:03:25.602952","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-26 13:56:22.161371","version":"1.17.1"}
\ No newline at end of file
This diff is collapsed.
......@@ -19,6 +19,7 @@ import 'package:encrateia/widgets/athlete_widgets/athlete_ecor_widget.dart';
import 'package:encrateia/screens/show_athlete_detail_screen.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:path_provider/path_provider.dart';
class ShowAthleteScreen extends StatefulWidget {
......@@ -63,127 +64,123 @@ class _ShowAthleteScreenState extends State<ShowAthleteScreen> {
icon: MyIcon.stravaDownload,
),
),
body: new OrientationBuilder(builder: (context, orientation) {
return GridView.count(
padding: EdgeInsets.all(5),
crossAxisCount: orientation == Orientation.portrait ? 2 : 4,
childAspectRatio: 3,
crossAxisSpacing: 3,
mainAxisSpacing: 3,
children: [
navigationButton(
color: MyColor.activity,
title: "Activities List",
icon: MyIcon.activities,
backgroundColor: MyColor.activity,
nextWidget: ActivitiesListWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Power",
icon: MyIcon.power,
nextWidget: AthletePowerWidget(athlete: widget.athlete),
),
navigationButton(
title: "Power Ratio",
color: MyColor.navigate,
icon: MyIcon.power,
nextWidget: AthletePowerRatioWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Power /\nHeart Rate",
icon: MyIcon.power,
nextWidget:
AthletePowerPerHeartRateWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Ecor",
icon: MyIcon.power,
nextWidget: AthleteEcorWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Stride Ratio",
icon: MyIcon.strideRatio,
nextWidget: AthleteStrideRatioWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Speed /\nHeart Rate",
icon: MyIcon.speed,
nextWidget:
AthleteSpeedPerHeartRateWidget(athlete: widget.athlete),
),
RaisedButton.icon(
color: MyColor.add,
textColor: MyColor.textColor(backgroundColor: MyColor.add),
icon: MyIcon.downloadLocal,
label: Text("Import .fit\nfrom Folder"),
onPressed: () => importLocal(),
),
navigationButton(
color: MyColor.settings,
title: "Body Weight",
icon: MyIcon.weight,
nextWidget: AthleteBodyWeightWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Power Zone\nSchemas",
icon: MyIcon.power,
nextWidget: AthletePowerZoneSchemaWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Heart Rate\nZone Schemas",
icon: MyIcon.heartRate,
nextWidget:
AthleteHeartRateZoneSchemaWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.tag,
title: "Tags",
icon: MyIcon.tag,
nextWidget: AthleteTagGroupWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Settings",
icon: MyIcon.settings,
nextWidget: AthleteSettingsWidget(athlete: widget.athlete),
),
RaisedButton.icon(
color: MyColor.danger,
textColor: MyColor.textColor(backgroundColor: MyColor.danger),
icon: MyIcon.delete,
label: Text("Delete\nAthlete"),
onPressed: () => deleteUser(),
),
RaisedButton.icon(
color: MyColor.settings,
icon: MyIcon.settings,
textColor: MyColor.textColor(backgroundColor: MyColor.add),
label: Text("Recalculate\nAverages"),
onPressed: () => recalculate(),
),
RaisedButton.icon(
color: MyColor.settings,
textColor: MyColor.textColor(backgroundColor: MyColor.settings),
icon: MyIcon.settings,
label: Text("Redo \n Autotagging"),
onPressed: () => redoAutoTagging(),
),
RaisedButton.icon(
color: MyColor.primary,
icon: MyIcon.download,
label: Text("Download\nDemo Data"),
onPressed: () => downloadDemoData(),
),
],
);
}),
body: StaggeredGridView.count(
staggeredTiles: List.filled(17, StaggeredTile.fit(1)),
crossAxisSpacing: 10,
padding: EdgeInsets.all(10),
crossAxisCount:
MediaQuery.of(context).orientation == Orientation.portrait ? 2 : 4,
children: [
navigationButton(
color: MyColor.activity,
title: "Activities List",
icon: MyIcon.activities,
backgroundColor: MyColor.activity,
nextWidget: ActivitiesListWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Power",
icon: MyIcon.power,
nextWidget: AthletePowerWidget(athlete: widget.athlete),
),
navigationButton(
title: "Power Ratio",
color: MyColor.navigate,
icon: MyIcon.power,
nextWidget: AthletePowerRatioWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Power /\nHeart Rate",
icon: MyIcon.power,
nextWidget: AthletePowerPerHeartRateWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Ecor",
icon: MyIcon.power,
nextWidget: AthleteEcorWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Stride Ratio",
icon: MyIcon.strideRatio,
nextWidget: AthleteStrideRatioWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.navigate,
title: "Speed /\nHeart Rate",
icon: MyIcon.speed,
nextWidget: AthleteSpeedPerHeartRateWidget(athlete: widget.athlete),
),
RaisedButton.icon(
color: MyColor.add,
textColor: MyColor.textColor(backgroundColor: MyColor.add),
icon: MyIcon.downloadLocal,
label: Text("Import .fit\nfrom Folder"),
onPressed: () => importLocal(),
),
navigationButton(
color: MyColor.settings,
title: "Body Weight",
icon: MyIcon.weight,
nextWidget: AthleteBodyWeightWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Power Zone\nSchemas",
icon: MyIcon.power,
nextWidget: AthletePowerZoneSchemaWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Heart Rate\nZone Schemas",
icon: MyIcon.heartRate,
nextWidget:
AthleteHeartRateZoneSchemaWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.tag,
title: "Tags",
icon: MyIcon.tag,
nextWidget: AthleteTagGroupWidget(athlete: widget.athlete),
),
navigationButton(
color: MyColor.settings,
title: "Settings",
icon: MyIcon.settings,
nextWidget: AthleteSettingsWidget(athlete: widget.athlete),
),
RaisedButton.icon(
color: MyColor.danger,
textColor: MyColor.textColor(backgroundColor: MyColor.danger),
icon: MyIcon.delete,
label: Text("Delete\nAthlete"),
onPressed: () => deleteUser(),
),
RaisedButton.icon(
color: MyColor.settings,
icon: MyIcon.settings,
textColor: MyColor.textColor(backgroundColor: MyColor.add),
label: Text("Recalculate\nAverages"),
onPressed: () => recalculate(),
),
RaisedButton.icon(
color: MyColor.settings,
textColor: MyColor.textColor(backgroundColor: MyColor.settings),
icon: MyIcon.settings,
label: Text("Redo\nAutotagging"),
onPressed: () => redoAutoTagging(),
),
RaisedButton.icon(
color: MyColor.primary,
icon: MyIcon.download,
label: Text("Download\nDemo Data"),
onPressed: () => downloadDemoData(),
),
],
),
);
}
......@@ -489,5 +486,4 @@ class _ShowAthleteScreenState extends State<ShowAthleteScreen> {
icon: MyIcon.finishedWhite,
)..show(context);
}
}
......@@ -16,6 +16,7 @@ import 'package:encrateia/widgets/lap_widgets/lap_vertical_oscillation_widget.da
import 'package:flutter/material.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
class ShowLapScreen extends StatelessWidget {
final Lap lap;
......@@ -39,108 +40,105 @@ class ShowLapScreen extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
),
body: new OrientationBuilder(builder: (context, orientation) {
return GridView.count(
padding: EdgeInsets.all(5),
crossAxisCount: orientation == Orientation.portrait ? 2 : 4,
childAspectRatio: 3,
crossAxisSpacing: 3,
mainAxisSpacing: 3,
children: [
navigationButton(
title: "Overview",
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapOverviewWidget(lap: lap),
),
navigationButton(
title: "Heart Rate",
color: MyColor.navigate,
icon: MyIcon.heartRate,
context: context,
nextWidget: ({lap}) => LapHeartRateWidget(lap: lap),
),
navigationButton(
title: "Power",
color: MyColor.navigate,
icon: MyIcon.power,
context: context,
nextWidget: ({lap}) => LapPowerWidget(lap: lap),
),
navigationButton(
title: "Power\nDuration",
color: MyColor.navigate,
icon: MyIcon.powerDuration,
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,
icon: MyIcon.groundTime,
context: context,
nextWidget: ({lap}) => LapGroundTimeWidget(lap: lap),
),
navigationButton(
title: "Leg Spring\nStiffness",
color: MyColor.navigate,
icon: MyIcon.legSpringStiffness,
context: context,
nextWidget: ({lap}) => LapLegSpringStiffnessWidget(lap: lap),
),
navigationButton(
title: "Form Power",
color: MyColor.navigate,
icon: MyIcon.formPower,
context: context,
nextWidget: ({lap}) => LapFormPowerWidget(lap: lap),
),
navigationButton(
title: "Cadence",
color: MyColor.navigate,
icon: MyIcon.cadence,
context: context,
nextWidget: ({lap}) => LapStrydCadenceWidget(lap: lap),
),
navigationButton(
title: "Vertical\nOscillation",
color: MyColor.navigate,
icon: MyIcon.verticalOscillation,
context: context,
nextWidget: ({lap}) => LapVerticalOscillationWidget(lap: lap),
),
navigationButton(
title: "Metadata",
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapMetadataWidget(lap: lap),
body: StaggeredGridView.count(
staggeredTiles: List.filled(12, StaggeredTile.fit(1)),
crossAxisSpacing: 10,
padding: EdgeInsets.all(10),
crossAxisCount:
MediaQuery.of(context).orientation == Orientation.portrait ? 2 : 4,
children: [
navigationButton(
title: "Overview",
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapOverviewWidget(lap: lap),
),
navigationButton(
title: "Heart Rate",
color: MyColor.navigate,
icon: MyIcon.heartRate,
context: context,
nextWidget: ({lap}) => LapHeartRateWidget(lap: lap),
),
navigationButton(
title: "Power",
color: MyColor.navigate,
icon: MyIcon.power,
context: context,
nextWidget: ({lap}) => LapPowerWidget(lap: lap),
),
navigationButton(
title: "Power\nDuration",
color: MyColor.navigate,
icon: MyIcon.powerDuration,
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: "Tags",
color: MyColor.tag,
icon: MyIcon.tag,
context: context,
nextWidget: ({lap}) => LapTagWidget(
lap: lap,
athlete: athlete,
),
),
navigationButton(
title: "Ground Time",
color: MyColor.navigate,
icon: MyIcon.groundTime,
context: context,
nextWidget: ({lap}) => LapGroundTimeWidget(lap: lap),
),
navigationButton(
title: "Leg Spring\nStiffness",
color: MyColor.navigate,
icon: MyIcon.legSpringStiffness,
context: context,
nextWidget: ({lap}) => LapLegSpringStiffnessWidget(lap: lap),
),
navigationButton(
title: "Form Power",
color: MyColor.navigate,
icon: MyIcon.formPower,
context: context,
nextWidget: ({lap}) => LapFormPowerWidget(lap: lap),
),
navigationButton(
title: "Cadence",
color: MyColor.navigate,
icon: MyIcon.cadence,
context: context,
nextWidget: ({lap}) => LapStrydCadenceWidget(lap: lap),
),
navigationButton(
title: "Vertical\nOscillation",
color: MyColor.navigate,
icon: MyIcon.verticalOscillation,
context: context,
nextWidget: ({lap}) => LapVerticalOscillationWidget(lap: lap),
),
navigationButton(
title: "Metadata",
color: MyColor.settings,
icon: MyIcon.metaData,
context: context,
nextWidget: ({lap}) => LapMetadataWidget(lap: lap),
),
navigationButton(
title: "Tags",
color: MyColor.tag,
icon: MyIcon.tag,
context: context,
nextWidget: ({lap}) => LapTagWidget(
lap: lap,
athlete: athlete,
),
],
);
}),
),
],
),
);
}
......
......@@ -56,9 +56,9 @@ class MyColor {
static Color save = success;
static Color cancel = warning;
static Color delete = danger;
static Color navigate = white;
static Color navigate = brightGoldenYellow;
static Color athlete = brightGoldenYellow;
static Color athlete = sunFlowerAccent;
static Color activity = aquaAccent;
static Color lap = grassAccent;
static Color tag = lavender;
......
......@@ -23,6 +23,7 @@ class LapsListWidget extends StatelessWidget {
if (snapshot.hasData) {
List<Lap> laps = snapshot.data;
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
showCheckboxColumn: false,
onSelectAll: (_) {},
......
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