Commit a9377eb1 authored by Administrator's avatar Administrator

finetuning flushbars during demo account setup

parent 8225ba7b
{"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 18:46:43.995469","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 15:52:27.826683","version":"1.17.3"}
\ No newline at end of file
......@@ -26,10 +26,11 @@ Future<void> downloadDemoData({
'upper_palatinate_winter_challenge_half_marathon.fit',
];
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
message: 'Downloading Demo data ...',
duration: const Duration(seconds: 5),
icon: MyIcon.stravaDownloadWhite,
animationDuration: const Duration(milliseconds: 0),
)..show(context);
for (final String filename in fileNames) {
......@@ -39,13 +40,6 @@ Future<void> downloadDemoData({
await activity.setState('downloaded');
}
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Downloading demo data finished',
duration: const Duration(seconds: 2),
icon: MyIcon.finishedWhite,
)..show(context);
activities = await athlete.activities;
final List<Activity> downloadedActivities = activities
.where((Activity activity) => activity.state == 'downloaded')
......@@ -57,21 +51,25 @@ Future<void> downloadDemoData({
athlete: athlete,
flushbar: flushbar,
);
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
message: 'Tagging »${activity.name}«',
animationDuration: const Duration(milliseconds: 0),
)..show(context);
await activity.autoTagger(athlete: athlete);
}
await flushbar.dismiss();
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
message: 'Activities imported!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
animationDuration: const Duration(milliseconds: 0),
)..show(context);
} else {
await flushbar.dismiss();
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
message:
'Please set up Power Zone Schema and Heart Rate Zone Schema first!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
message: 'Please set up Power Zone Schema and Heart'
' Rate Zone Schema first!',
animationDuration: const Duration(milliseconds: 0),
)..show(context);
}
}
......@@ -9,23 +9,30 @@ Future<void> parseActivity({
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
await flushbar.dismiss();
await 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),
animationDuration: const Duration(milliseconds: 0),
)..show(context);
final Stream<int> percentageStream = activity.parse(athlete: athlete);
await for (final int value in percentageStream) {
await flushbar.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${activity.name}«',
duration: const Duration(seconds: 10),
animationDuration: const Duration(milliseconds: 1),
)..show(context);
if (value == -2)
await flushbar?.dismiss();
else if (value == -1) {
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
message: 'Analysing »${activity.name}«',
animationDuration: const Duration(milliseconds: 0),
)..show(context);
} else {
await flushbar?.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${activity.name}«',
animationDuration: const Duration(milliseconds: 0),
)..show(context);
}
}
await flushbar.dismiss();
}
......@@ -32,4 +32,5 @@ Future<void> setupDemoAthlete({
athlete: athlete,
flushbar: flushbar,
);
await flushbar?.dismiss();
}
......@@ -354,9 +354,9 @@ class Activity {
}
state = 'persisted';
yield -1;
await setAverages();
print('Activity data for »$name« stored in database.');
yield 100;
yield -2;
}
Future<int> handleDataMessage({DataMessage dataMessage}) async {
......
......@@ -32,8 +32,8 @@ class _DashboardState extends State<Dashboard> {
onWillPop: () => Future<bool>(() => false),
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.primary,
automaticallyImplyLeading: false,
title: const Text('Encrateia Dashboard'),
),
body: ListView(
......@@ -82,7 +82,7 @@ class _DashboardState extends State<Dashboard> {
Future<void> getData() async {
athletes = await Athlete.all();
if (athletes.isEmpty) {
await Navigator.push(
await Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext context) =>
......
......@@ -28,7 +28,6 @@ class _OnboardingCreateUserScreenState
onWillPop: () => Future<bool>(() => false),
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: MyColor.primary,
title: const Text('Creating an Athlete'),
),
......@@ -59,7 +58,7 @@ class _OnboardingCreateUserScreenState
context: context,
flushbar: flushbar,
);
await Navigator.push(
await Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
......
......@@ -35,7 +35,7 @@ class OnboardingFinishedScreen extends StatelessWidget {
FlatButton(
child: const Text('Finish'),
onPressed: () async {
await Navigator.push(
await Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) => const Dashboard(),
......
......@@ -16,7 +16,6 @@ class OnboardingIntroductionScreen extends StatelessWidget {
appBar: AppBar(
backgroundColor: MyColor.primary,
title: const Text('Welcome to Encrateia!'),
automaticallyImplyLeading: false,
),
body: Padding(
padding: const EdgeInsets.all(20),
......@@ -47,7 +46,7 @@ class OnboardingIntroductionScreen extends StatelessWidget {
FlatButton(
child: const Text('Continue'),
onPressed: () async {
await Navigator.push(
await Navigator.pushReplacement(
context,
MaterialPageRoute<BuildContext>(
builder: (BuildContext _) =>
......
......@@ -81,10 +81,9 @@ class _ActivitiesListWidgetState extends State<ActivitiesListWidget> {
await activity.download(athlete: widget.athlete);
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 1),
duration: const Duration(seconds: 3),
icon: MyIcon.finishedWhite,
)..show(context);
......
......@@ -245,7 +245,7 @@ packages:
name: flushbar
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.2"
version: "1.10.4"
flutter:
dependency: "direct main"
description: flutter
......
......@@ -17,7 +17,7 @@ dependencies:
dio: ^3.0.7
dio_cookie_manager: ^1.0.0
fit_parser: ^0.1.8
flushbar: 1.10.2
flushbar: 1.10.4
flutter_launcher_icons: ^0.7.2
flutter_markdown: ^0.4.1
flutter_material_color_picker: ^1.0.5
......
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