Commit 7084609e authored by Administrator's avatar Administrator

extracting actions from show athlete screen

parent 36bd21c9
{"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-15 09:10:40.515263","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-15 15:47:34.056276","version":"1.17.3"}
\ No newline at end of file
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> analyseActivities({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
List<Activity> activities;
activities = await athlete.activities;
int index = 0;
int percent;
flushbar = Flushbar<Object>(
message: 'Calculating...',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
for (final Activity activity in activities) {
index += 1;
await activity.setAverages();
flushbar.dismiss();
percent = 100 * index ~/ activities.length;
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: percent / 100),
message: '$percent% done (recalculating »${activity.name}« )',
duration: const Duration(seconds: 2),
animationDuration: const Duration(milliseconds: 1),
)..show(context);
}
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Averages are now up to date.',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
}
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/tag_group.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> autoTagging({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
if (await athlete.checkForSchemas()) {
flushbar = Flushbar<Object>(
message: 'Started cleaning up...',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
List<Activity> activities;
activities = await athlete.activities;
int index = 0;
int percent;
await TagGroup.deleteAllAutoTags(athlete: athlete);
flushbar = Flushbar<Object>(
message: 'All existing autotaggings have been deleted.',
duration: const Duration(seconds: 2),
icon: MyIcon.finishedWhite,
)..show(context);
for (final Activity activity in activities) {
index += 1;
await activity.autoTagger(athlete: athlete);
flushbar.dismiss();
percent = 100 * index ~/ activities.length;
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: percent / 100),
message: '$percent% done (autotagging »${activity.name}« )',
duration: const Duration(seconds: 2),
animationDuration: const Duration(milliseconds: 1),
)..show(context);
}
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Autotaggings are now up to date.',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
} else {
flushbar = Flushbar<Object>(
message:
'Please set up Power Zone Schema and Heart Rate Zone Schema first!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
}
}
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/my_button.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> deleteAthlete({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Are you sure?'),
content: SingleChildScrollView(
child: ListBody(
children: const <Widget>[
Text('All the athlete\'s data including'),
Text('activities will be deleted as well.'),
Text('There is no undo function.'),
],
),
),
actions: <Widget>[
MyButton.cancel(
onPressed: () {
Navigator.of(context).pop();
},
),
MyButton.delete(
onPressed: () async {
await athlete.delete();
Navigator.of(context)
.popUntil((Route<dynamic> route) => route.isFirst);
},
),
],
);
},
);
}
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> downloadActivity({
@required BuildContext context,
@required Activity activity,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download .fit-File for »${activity.name}«',
duration: const Duration(seconds: 10),
icon: MyIcon.stravaDownloadWhite,
)..show(context);
await activity.download(athlete: athlete);
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 2),
icon: MyIcon.finishedWhite,
)..show(context);
}
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:encrateia/actions/parse_activity.dart';
Future<void> downloadDemoData({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
if (await athlete.checkForSchemas()) {
List<Activity> activities;
final Directory appDocDir = await getApplicationDocumentsDirectory();
final Dio dio = Dio();
const String downloadDir =
'https://encrateia.informatom.com/assets/fit-files/';
final List<String> fileNames = <String>[
'munich_half_marathon.fit',
'listener_meetup_run_cologne.fit',
'stockholm_half_marathon.fit',
'upper_palatinate_winter_challenge_half_marathon.fit',
];
flushbar = Flushbar<Object>(
message: 'Downloading Demo data ...',
duration: const Duration(seconds: 1),
icon: MyIcon.stravaDownloadWhite,
)..show(context);
for (final String filename in fileNames) {
final Activity activity = Activity.fromLocalDirectory(athlete: athlete);
await dio.download(downloadDir + filename,
appDocDir.path + '/' + activity.stravaId.toString() + '.fit');
await activity.setState('downloaded');
}
flushbar = Flushbar<Object>(
message: 'Downloading demo data finished',
duration: const Duration(seconds: 1),
icon: MyIcon.finishedWhite,
)..show(context);
activities = await athlete.activities;
final List<Activity> downloadedActivities = activities
.where((Activity activity) => activity.state == 'downloaded')
.toList();
for (final Activity activity in downloadedActivities) {
await parseActivity(
context: context,
activity: activity,
athlete: athlete,
flushbar: flushbar,
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Activities imported!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
} else {
flushbar = Flushbar<Object>(
message:
'Please set up Power Zone Schema and Heart Rate Zone Schema first!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
}
}
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/actions/parse_activity.dart';
Future<void> importActivitiesLocally({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
List<Activity> activities;
flushbar = Flushbar<Object>(
message: 'Importing activities from local directory',
duration: const Duration(seconds: 1),
icon: MyIcon.stravaDownloadWhite,
)..show(context);
await Activity.importFromLocalDirectory(athlete: athlete);
flushbar = Flushbar<Object>(
message: 'Activities moved into application',
duration: const Duration(seconds: 1),
icon: MyIcon.finishedWhite,
)..show(context);
activities = await athlete.activities;
final List<Activity> downloadedActivities = activities
.where((Activity activity) => activity.state == 'downloaded')
.toList();
for (final Activity activity in downloadedActivities) {
await parseActivity(
context: context,
activity: activity,
athlete: athlete,
flushbar: flushbar,
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Activities imported!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
}
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> parseActivity({
@required BuildContext context,
@required Activity activity,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: '0% of storing »${activity.name}«',
duration: const Duration(seconds: 10),
animationDuration: const Duration(milliseconds: 1),
titleText: const LinearProgressIndicator(value: 0),
)..show(context);
final Stream<int> percentageStream = activity.parse(athlete: athlete);
await for (final int value in percentageStream) {
flushbar.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${activity.name}«',
duration: const Duration(seconds: 20),
animationDuration: const Duration(milliseconds: 1),
)..show(context);
}
}
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
Future<void> queryStrava({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
flushbar = Flushbar<Object>(
message: 'Downloading new activities',
duration: const Duration(seconds: 10),
icon: MyIcon.stravaDownloadWhite,
)..show(context);
await Activity.queryStrava(athlete: athlete);
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 1),
icon: MyIcon.finishedWhite,
)..show(context);
}
import 'package:encrateia/actions/download_activity.dart';
import 'package:encrateia/models/activity.dart';
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/actions/query_strava.dart';
import 'package:encrateia/actions/parse_activity.dart';
Future<void> updateJob({
@required BuildContext context,
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
List<Activity> activities;
if (await athlete.checkForSchemas()) {
await queryStrava(
context: context,
athlete: athlete,
flushbar: flushbar,
);
activities = await athlete.activities;
final Iterable<Activity> newActivities =
activities.where((Activity activity) => activity.state == 'new');
for (final Activity activity in newActivities) {
await downloadActivity(
context: context,
activity: activity,
athlete: athlete,
flushbar: flushbar,
);
}
final Iterable<Activity> downloadedActivities =
activities.where((Activity activity) => activity.state == 'downloaded');
for (final Activity activity in downloadedActivities) {
await parseActivity(
context: context,
activity: activity,
athlete: athlete,
flushbar: flushbar,
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'You are now up to date!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
} else {
flushbar = Flushbar<Object>(
message:
'Please set up Power Zone Schema and Heart Rate Zone Schema first!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
}
}
......@@ -65,8 +65,8 @@ class _DashboardState extends State<Dashboard> {
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) => const OnboardingCreateUserScreen(
),
builder: (BuildContext context) =>
const OnboardingCreateUserScreen(),
),
);
getData();
......@@ -77,14 +77,15 @@ class _DashboardState extends State<Dashboard> {
Future<void> getData() async {
athletes = await Athlete.all();
if(athletes.isEmpty)
Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
const OnboardingIntroductionScreen(),
),
);
if (athletes.isEmpty) {
await Navigator.push(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
const OnboardingIntroductionScreen(),
),
);
}
setState(() {});
}
}
import 'package:encrateia/models/heart_rate_zone_schema.dart';
import 'package:encrateia/models/power_zone_schema.dart';
import 'package:encrateia/models/weight.dart';
import 'package:encrateia/screens/onboarding_screens/onboarding_finished_screen.dart';
......@@ -23,93 +24,100 @@ class _OnboardingCreateUserScreenState
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: MyColor.primary,
title: const Text('Creating an Athlete'),
),
body: ListView(
children: <Widget>[
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: MyIcon.create,
title: const Text('Option 1: Demo Athlete Setup'),
subtitle: const Text(
'Choose this option to create a demo user with demo setup.'
'This is the quickest option to explore Encrateia.'),
),
ButtonBar(
return WillPopScope(
onWillPop: () async => false,
child: Scaffold(
appBar: AppBar(
backgroundColor: MyColor.primary,
title: const Text('Creating an Athlete'),
),
body: Padding(
padding: const EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatButton(
child: const Text('Create Demo User'),
onPressed: () async {
await demoAthleteSetup();
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
const OnboardingFinishedScreen(),
);
},
)
ListTile(
leading: MyIcon.create,
title: const Text('Option 1: Demo Athlete Setup'),
subtitle: const Text(
'Choose this option to create a demo user with demo setup.'
'This is the quickest option to explore Encrateia.'),
),
ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('Create Demo User'),
onPressed: () async {
await demoAthleteSetup();
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
const OnboardingFinishedScreen(),
);
},
)
],
),
],
),
],
),
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: MyIcon.download,
title: const Text('Option 2: Athlete with Strava Account'),
subtitle: const Text(
'Choose this option, if you want to download activities '
'from Strava'),
),
ButtonBar(
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatButton(
child: const Text('Connect to Strava'),
onPressed: () => stravaGetUser(context),
)
ListTile(
leading: MyIcon.download,
title:
const Text('Option 2: Athlete with Strava Account'),
subtitle: const Text(
'Choose this option, if you want to download activities '
'from Strava'),
),
ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('Connect to Strava'),
onPressed: () => stravaGetUser(context),
)
],
),
],
),
],
),
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: MyIcon.upload,
title: const Text('Option 3: Standalone Athlete'),
subtitle:
const Text('Choose this option, if you want to upload all'
' .fit-files manually'),
),
ButtonBar(
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatButton(
child: const Text('Create standalone User'),
onPressed: () {
athlete.setupStandaloneAthlete();
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingStravaCredentialsScreen(
athlete: athlete),
);
},
)
ListTile(
leading: MyIcon.upload,
title: const Text('Option 3: Standalone Athlete'),
subtitle: const Text(
'Choose this option, if you want to upload all'
' .fit-files manually'),
),
ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('Create standalone User'),
onPressed: () {
athlete.setupStandaloneAthlete();
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
OnBoardingStravaCredentialsScreen(
athlete: athlete),
);
},