Commit 828a5120 authored by Stefan Haslinger's avatar Stefan Haslinger

stop user from going back in onboarding wizard once a user has been created,...

stop user from going back in onboarding wizard once a user has been created, allow user to leave back using back, clear the stack after running through the wizard
parent 8828a6b9
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/daten/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-07-23 12:21:30.703623","version":"1.17.5"}
\ 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":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.10/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/daten/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/daten/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-07-23 12:41:24.707370","version":"1.17.5"}
\ No newline at end of file
......@@ -28,56 +28,53 @@ class _DashboardState extends State<Dashboard> {
if (athletes.isEmpty)
return Container();
else {
return WillPopScope(
onWillPop: () => Future<bool>(() => false),
child: Scaffold(
appBar: AppBar(
backgroundColor: MyColor.primary,
automaticallyImplyLeading: false,
title: const Text('Encrateia Dashboard'),
),
body: SafeArea(
child: ListView(
padding: const EdgeInsets.all(20),
children: <Widget>[
for (Athlete athlete in athletes)
Card(
child: ListTile(
leading: athlete.photoPath != null
? Image.network(athlete.photoPath)
: MyIcon.runningBig,
title: Text('${athlete.firstName} ${athlete.lastName}'),
onTap: () async {
await athlete.readCredentials();
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
ShowAthleteScreen(athlete: athlete),
),
);
getData();
},
),
return Scaffold(
appBar: AppBar(
backgroundColor: MyColor.primary,
automaticallyImplyLeading: false,
title: const Text('Encrateia Dashboard'),
),
body: SafeArea(
child: ListView(
padding: const EdgeInsets.all(20),
children: <Widget>[
for (Athlete athlete in athletes)
Card(
child: ListTile(
leading: athlete.photoPath != null
? Image.network(athlete.photoPath)
: MyIcon.runningBig,
title: Text('${athlete.firstName} ${athlete.lastName}'),
onTap: () async {
await athlete.readCredentials();
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
ShowAthleteScreen(athlete: athlete),
),
);
getData();
},
),
],
),
),
floatingActionButton: FloatingActionButton.extended(
backgroundColor: MyColor.add,
label: const Text('Add Athlete'),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
const OnboardingCreateUserScreen(),
),
);
getData();
},
],
),
),
floatingActionButton: FloatingActionButton.extended(
backgroundColor: MyColor.add,
label: const Text('Add Athlete'),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
const OnboardingCreateUserScreen(),
),
);
getData();
},
),
);
}
}
......
......@@ -22,34 +22,37 @@ 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: SafeArea(
child: Column(
children: <Widget>[
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),
]),
const Spacer(),
],
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Enter your weight'),
),
body: SafeArea(
child: Column(
children: <Widget>[
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),
]),
const Spacer(),
],
),
),
),
);
......
......@@ -36,11 +36,12 @@ class OnboardingFinishedScreen extends StatelessWidget {
FlatButton(
child: const Text('Finish'),
onPressed: () async {
await Navigator.pushReplacement(
await Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) => const Dashboard(),
),
(_) => false,
);
},
)
......
......@@ -22,40 +22,44 @@ 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: SafeArea(
child: Column(
children: <Widget>[
AthleteHeartRateZoneSchemaWidget(athlete: widget.athlete),
const Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Text('You might want to check the base value for the Heart '
'Rate Zone Scheme before proceeding to the next step.'),
),
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,
),
),
);
},
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Select a Heart Rate Zone Schema'),
),
body: SafeArea(
child: Column(
children: <Widget>[
AthleteHeartRateZoneSchemaWidget(athlete: widget.athlete),
const Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child:
Text('You might want to check the base value for the Heart '
'Rate Zone Scheme before proceeding to the next step.'),
),
const SizedBox(width: 20),
]),
const Spacer(),
],
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),
]),
const Spacer(),
],
),
),
),
);
......
......@@ -22,41 +22,45 @@ 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: SafeArea(
child: Column(
children: <Widget>[
AthletePowerZoneSchemaWidget(athlete: widget.athlete),
const Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Text('You might want to check the base value for the Power '
'Zone Scheme before proceeding to the next step.'),
),
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,
),
),
);
},
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Select a Power Zone Schema'),
),
body: SafeArea(
child: Column(
children: <Widget>[
AthletePowerZoneSchemaWidget(athlete: widget.athlete),
const Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child:
Text('You might want to check the base value for the Power '
'Zone Scheme before proceeding to the next step.'),
),
const SizedBox(width: 20),
]),
const Spacer(),
],
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),
]),
const Spacer(),
],
),
),
),
);
......
......@@ -13,13 +13,17 @@ class OnBoardingStandaloneCredentialsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: MyColor.athlete,
title: const Text('Enter the Athlete\'s Name'),
),
body: SafeArea(
child: EditStandaloneAthleteWidget(athlete: athlete),
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Enter the Athlete\'s Name'),
),
body: SafeArea(
child: EditStandaloneAthleteWidget(athlete: athlete),
),
),
);
}
......
......@@ -13,13 +13,17 @@ class OnBoardingStravaCredentialsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: MyColor.athlete,
title: const Text('Athlete Credentials'),
),
body: SafeArea(
child: EditStravaAthleteWidget(athlete: athlete),
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.athlete,
title: const Text('Athlete Credentials'),
),
body: SafeArea(
child: EditStravaAthleteWidget(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