Commit 87533844 authored by Stefan Haslinger's avatar Stefan Haslinger

extracted dashboard widget

parent ea388f44
......@@ -32,7 +32,6 @@ android {
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.informatom.encrateia"
minSdkVersion 16
targetSdkVersion 28
......
import 'package:flutter/material.dart';
import 'screens/edit_athlete.dart';
import 'screens/dashboard.dart';
void main() => runApp(MyApp());
......@@ -16,70 +16,3 @@ class MyApp extends StatelessWidget {
}
}
class Dashboard extends StatelessWidget {
final String title;
Widget widget;
Dashboard({this.title});
@override
Widget build(BuildContext context) {
if (true) {
widget = ListView(padding: EdgeInsets.all(20), children: <Widget>[
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.help),
title: Text('Welcome to Encrateia!'),
subtitle: Text('Maybe you want to learn more about Encrateia.'
'We have provided some introductory help for you.')),
ButtonTheme.bar(
child: ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('HELP'),
onPressed: () {},
)
],
))
],
)),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.face),
title: Text('Who are you?'),
subtitle: Text('This app stores date associated to one athlete '
'(you) or many athletes (if you act as a trainer).'
'\n Please create your first athlete!')),
ButtonTheme.bar(
child: ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('CREATE NEW ATHLETE'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditAthleteScreen()),
);
},
)
],
))
],
))
]);
}
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: widget);
}
}
import 'package:flutter/material.dart';
import 'edit_athlete.dart';
class Dashboard extends StatelessWidget {
final String title;
Dashboard({this.title});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: ListView(padding: EdgeInsets.all(20), children: <Widget>[
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.help),
title: Text('Welcome to Encrateia!'),
subtitle: Text('Maybe you want to learn more about Encrateia.'
'We have provided some introductory help for you.')),
ButtonTheme.bar(
child: ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('HELP'),
onPressed: () {},
)
],
))
],
)),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.face),
title: Text('Who are you?'),
subtitle:
Text('This app stores date associated to one athlete '
'(you) or many athletes (if you act as a trainer).'
'\n Please create your first athlete!')),
ButtonTheme.bar(
child: ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('CREATE NEW ATHLETE'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditAthleteScreen()),
);
},
)
],
))
],
))
]));
}
}
......@@ -7,7 +7,7 @@ import 'package:strava_flutter/Models/activity.dart';
class StravaLogin extends StatefulWidget {
final String title = "Strava Login";
StravaLogin() {}
StravaLogin();
@override
_StravaLoginState createState() => _StravaLoginState();
......@@ -35,7 +35,7 @@ class _StravaLoginState extends State<StravaLogin> {
child: Scaffold(
appBar: AppBar(title: Text('Create Athlete')),
body: Container(child:
Text("isAuthOk ${isAuthOk} \n"
Text("isAuthOk $isAuthOk \n"
"stravaAthlete ${athlete?.firstname} \n"
"activities ${activities?.length}"))
)
......
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
analyzer:
dependency: transitive
......@@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "2.1.0"
boolean_selector:
dependency: transitive
description:
......@@ -105,7 +105,7 @@ packages:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.1"
code_builder:
dependency: transitive
description:
......@@ -353,14 +353,14 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.5.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "2.2.1"
plugin:
dependency: transitive
description:
......@@ -395,7 +395,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
version: "2.0.2"
scoped_model:
dependency: "direct main"
description:
......@@ -505,7 +505,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.5"
version: "0.2.4"
timing:
dependency: transitive
description:
......@@ -554,7 +554,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
version: "3.4.1"
yaml:
dependency: transitive
description:
......@@ -563,5 +563,5 @@ packages:
source: hosted
version: "2.1.16"
sdks:
dart: ">=2.4.0 <3.0.0"
dart: ">=2.2.0 <3.0.0"
flutter: ">=1.5.0 <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