Commit 508f711a authored by Administrator's avatar Administrator

gridview orientation fix in athlete diagrams

parent 801b8c90
......@@ -75,102 +75,101 @@ class _AthleteTimeSeriesChartState extends State<AthleteTimeSeriesChart> {
)..setAttribute(rendererIdKey, 'glidingAverageRenderer'),
];
return new Column(children: [
Container(
height: 300,
child: TimeSeriesChart(
data,
animate: true,
selectionModels: [
SelectionModelConfig(
type: SelectionModelType.info,
changedListener: _onSelectionChanged,
)
],
defaultRenderer: LineRendererConfig(
includePoints: true,
includeLine: false,
),
customSeriesRenderers: [
LineRendererConfig(
customRendererId: 'glidingAverageRenderer',
dashPattern: [1, 2],
return Column(
children: [
Container(
height: 300,
child: TimeSeriesChart(
data,
animate: true,
selectionModels: [
SelectionModelConfig(
type: SelectionModelType.info,
changedListener: _onSelectionChanged,
)
],
defaultRenderer: LineRendererConfig(
includePoints: true,
includeLine: false,
),
],
primaryMeasureAxis: NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: false,
desiredTickCount: 6,
customSeriesRenderers: [
LineRendererConfig(
customRendererId: 'glidingAverageRenderer',
dashPattern: [1, 2],
),
],
primaryMeasureAxis: NumericAxisSpec(
tickProviderSpec: BasicNumericTickProviderSpec(
zeroBound: false,
dataIsInWholeNumbers: false,
desiredTickCount: 6,
),
),
behaviors: [
ChartTitle(
widget.chartTitleText,
titleStyleSpec: TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.start,
titleOutsideJustification: OutsideJustification.end,
),
ChartTitle(
'Date',
titleStyleSpec: TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
),
behaviors: [
ChartTitle(
widget.chartTitleText,
titleStyleSpec: TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.start,
titleOutsideJustification: OutsideJustification.end,
),
ChartTitle(
'Date',
titleStyleSpec: TextStyleSpec(fontSize: 13),
behaviorPosition: BehaviorPosition.bottom,
titleOutsideJustification: OutsideJustification.end,
),
],
),
),
if (selectedActivity != null)
Container(
height: 200,
child: 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: [
MyButton.activity(
child: Text(selectedActivity.db.name),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ShowActivityScreen(
activity: selectedActivity,
athlete: widget.athlete,
),
if (selectedActivity != null)
Container(
height: 200,
child: GridView.count(
padding: EdgeInsets.all(5),
crossAxisCount:
MediaQuery.of(context).orientation == Orientation.landscape
? 4
: 2,
childAspectRatio: 4,
crossAxisSpacing: 3,
mainAxisSpacing: 3,
children: [
MyButton.activity(
child: Text(selectedActivity.db.name),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ShowActivityScreen(
activity: selectedActivity,
athlete: widget.athlete,
),
),
),
ListTile(
title: Text(DateFormat("dd MMM yyyy, h:mm:ss")
.format(selectedActivity.db.timeCreated)),
subtitle: Text("Time created"),
),
ListTile(
title:
Text(selectedActivity.db.distance.toString() + " m"),
subtitle: Text('Distance')),
ListTile(
title: Text(
selectedActivity.db.avgSpeed.toPace() + " min/km"),
subtitle: Text('Average speed')),
ListTile(
title: Text(
selectedActivity.db.avgPower.toStringAsFixed(1) +
" W"),
subtitle: Text('Average power')),
ListTile(
title: Text(
selectedActivity.db.avgHeartRate.toString() + " bpm"),
subtitle: Text('Average heart rate')),
],
);
},
),
ListTile(
title: Text(DateFormat("dd MMM yyyy, h:mm:ss")
.format(selectedActivity.db.timeCreated)),
subtitle: Text("Time created"),
),
ListTile(
title: Text(selectedActivity.db.distance.toString() + " m"),
subtitle: Text('Distance')),
ListTile(
title:
Text(selectedActivity.db.avgSpeed.toPace() + " min/km"),
subtitle: Text('Average speed')),
ListTile(
title: Text(
selectedActivity.db.avgPower.toStringAsFixed(1) + " W"),
subtitle: Text('Average power')),
ListTile(
title: Text(
selectedActivity.db.avgHeartRate.toString() + " bpm"),
subtitle: Text('Average heart rate')),
],
),
),
)
]);
],
);
}
}
......@@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "3.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.7"
version: "0.39.8"
archive:
dependency: transitive
description:
......@@ -49,7 +49,7 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
version: "1.3.0"
build_config:
dependency: transitive
description:
......@@ -70,21 +70,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.7"
version: "1.3.8"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.10.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
version: "5.2.0"
build_verify:
dependency: "direct dev"
description:
......@@ -309,7 +309,7 @@ packages:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.0+4"
version: "0.12.1"
http_multi_server:
dependency: transitive
description:
......@@ -400,14 +400,14 @@ packages:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.1.1"
node_io:
dependency: transitive
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1+2"
version: "1.1.1"
node_preamble:
dependency: transitive
description:
......@@ -442,21 +442,21 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.7"
version: "1.6.8"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+1"
version: "0.0.4+2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.2"
pedantic:
dependency: transitive
description:
......@@ -526,28 +526,28 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.7"
version: "0.5.7+2"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+7"
version: "0.0.1+8"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+4"
version: "0.1.2+5"
shelf:
dependency: transitive
description:
......@@ -629,14 +629,14 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.0+1"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0+1"
version: "1.0.1"
stack_trace:
dependency: transitive
description:
......@@ -650,7 +650,7 @@ packages:
name: strava_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1+54"
version: "1.2.1+58"
stream_channel:
dependency: transitive
description:
......@@ -727,14 +727,14 @@ packages:
name: uni_links
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "0.4.0"
url_launcher:
dependency: transitive
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.4.5"
version: "5.4.7"
url_launcher_macos:
dependency: transitive
description:
......@@ -748,14 +748,14 @@ packages:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
version: "1.0.7"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+2"
version: "0.1.1+5"
uuid:
dependency: "direct main"
description:
......@@ -804,7 +804,7 @@ packages:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "2.2.1"
sdks:
dart: ">=2.7.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
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