Commit 2edcb775 authored by Administrator's avatar Administrator

wizard for setting up standalone athlete

parent a9377eb1
{"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.10/","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.10/","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-06-16 15:52:27.826683","version":"1.17.3"}
\ 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.10/","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.10/","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-06-16 17:26:56.038656","version":"1.17.3"}
\ No newline at end of file
import 'package:encrateia/screens/onboarding_screens/onboarding_finished_screen.dart';
import 'package:encrateia/utils/my_button.dart';
import 'package:encrateia/utils/my_color.dart';
import 'package:encrateia/widgets/athlete_widgets/athlete_body_weight_widget.dart';
import 'package:encrateia/widgets/athlete_widgets/athlete_heart_rate_zone_schema_widget.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/athlete.dart';
class OnBoardingBodyWeightScreen extends StatefulWidget {
const OnBoardingBodyWeightScreen({
Key key,
this.athlete,
}) : super(key: key);
final Athlete athlete;
@override
_OnBoardingBodyWeightScreenState createState() =>
_OnBoardingBodyWeightScreenState();
}
class _OnBoardingBodyWeightScreenState
extends State<OnBoardingBodyWeightScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Enter your weight'),
),
body: Column(
children: <Widget>[
Expanded(
child: AthleteBodyWeightWidget(athlete: widget.athlete),
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
MyButton.save(
child: const Text('Next step'),
onPressed: () async {
await widget.athlete.save();
Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
const OnboardingFinishedScreen(),
),
);
},
),
const SizedBox(width: 20),
]),
],
),
);
}
}
......@@ -9,6 +9,8 @@ import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/screens/strava_get_user.dart';
import 'onboarding_standalone_credentials_screen.dart';
class OnboardingCreateUserScreen extends StatefulWidget {
const OnboardingCreateUserScreen();
......@@ -132,7 +134,7 @@ class _OnboardingCreateUserScreenState
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingStravaCredentialsScreen(
OnBoardingStandaloneCredentialsScreen(
athlete: athlete),
),
);
......
......@@ -14,7 +14,7 @@ class OnboardingFinishedScreen extends StatelessWidget {
child: Scaffold(
appBar: AppBar(
backgroundColor: MyColor.primary,
title: const Text('Athlete created'),
title: const Text('Athlete setup successfully'),
automaticallyImplyLeading: false,
),
body: Padding(
......
import 'package:encrateia/screens/onboarding_screens/onboarding_body_weight_screen.dart';
import 'package:encrateia/utils/my_button.dart';
import 'package:encrateia/utils/my_color.dart';
import 'package:encrateia/widgets/athlete_widgets/athlete_heart_rate_zone_schema_widget.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/athlete.dart';
class OnBoardingHeartRateZoneSchemaScreen extends StatefulWidget {
const OnBoardingHeartRateZoneSchemaScreen({
Key key,
this.athlete,
}) : super(key: key);
final Athlete athlete;
@override
_OnBoardingHeartRateZoneSchemaScreenState createState() =>
_OnBoardingHeartRateZoneSchemaScreenState();
}
class _OnBoardingHeartRateZoneSchemaScreenState
extends State<OnBoardingHeartRateZoneSchemaScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Select a Heart Rate Zone Schema'),
),
body: Column(
children: <Widget>[
Expanded(
child: AthleteHeartRateZoneSchemaWidget(athlete: widget.athlete),
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
MyButton.save(
child: const Text('Next step'),
onPressed: () async {
await widget.athlete.save();
Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingBodyWeightScreen(
athlete: widget.athlete,
),
),
);
},
),
const SizedBox(width: 20),
]),
],
),
);
}
}
import 'package:encrateia/screens/onboarding_screens/onboarding_heart_rate_zone_schema_screen.dart';
import 'package:encrateia/utils/my_button.dart';
import 'package:encrateia/utils/my_color.dart';
import 'package:encrateia/widgets/athlete_widgets/athlete_power_zone_schema_widget.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/athlete.dart';
class OnBoardingPowerZoneSchemaScreen extends StatefulWidget {
const OnBoardingPowerZoneSchemaScreen({
Key key,
this.athlete,
}) : super(key: key);
final Athlete athlete;
@override
_OnBoardingPowerZoneSchemaScreenState createState() =>
_OnBoardingPowerZoneSchemaScreenState();
}
class _OnBoardingPowerZoneSchemaScreenState
extends State<OnBoardingPowerZoneSchemaScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Select a Power Zone Schema'),
),
body: Column(
children: <Widget>[
Expanded(
child: AthletePowerZoneSchemaWidget(athlete: widget.athlete),
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
MyButton.save(
child: const Text('Next step'),
onPressed: () async {
await widget.athlete.save();
Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingHeartRateZoneSchemaScreen(
athlete: widget.athlete,
),
),
);
},
),
const SizedBox(width: 20),
]),
],
),
);
}
}
......@@ -4,6 +4,7 @@ import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'onboarding_power_zone_schema_screen.dart';
class OnBoardingStandaloneCredentialsScreen extends StatefulWidget {
const OnBoardingStandaloneCredentialsScreen({
......@@ -27,7 +28,7 @@ class _OnBoardingStandaloneCredentialsScreenState
return Scaffold(
appBar: AppBar(
backgroundColor: MyColor.athlete,
title: const Text('Enter Name'),
title: const Text('Define Power Zone Schema'),
),
body: ListView(
padding: const EdgeInsets.all(20),
......@@ -55,12 +56,19 @@ class _OnBoardingStandaloneCredentialsScreenState
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
MyButton.cancel(
onPressed: () => Navigator.of(context).pop(),
),
Container(width: 20.0),
MyButton.save(
onPressed: () => saveStandaloneUser(context),
onPressed: () async {
await widget.athlete.save();
Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingPowerZoneSchemaScreen(
athlete: widget.athlete,
),
),
);
},
),
],
),
......@@ -69,13 +77,4 @@ class _OnBoardingStandaloneCredentialsScreenState
),
);
}
Future<void> saveStandaloneUser(BuildContext context) async {
widget.athlete.firstName =
widget.athlete.firstName ?? widget.athlete.firstName;
widget.athlete.lastName =
widget.athlete.lastName ?? widget.athlete.lastName;
await widget.athlete.save();
Navigator.of(context).pop();
}
}
......@@ -131,6 +131,8 @@ Put one date and weight per line in the following format:
2020-04-28,75.3
Or you can simply enter your current weight using the New Weighting button.
Please also enter at least a rough estimate default weight for your former activities.
You can change these later.
'''),
),
Row(
......
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