Commit 8225ba7b authored by Administrator's avatar Administrator

should await flushbar.dismiss()

parent e1299066
......@@ -23,7 +23,7 @@ Future<void> analyseActivities({
for (final Activity activity in activities) {
index += 1;
await activity.setAverages();
flushbar.dismiss();
await flushbar.dismiss();
percent = 100 * index ~/ activities.length;
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: percent / 100),
......@@ -33,7 +33,7 @@ Future<void> analyseActivities({
)..show(context);
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Averages are now up to date.',
duration: const Duration(seconds: 5),
......
......@@ -32,7 +32,7 @@ Future<void> autoTagging({
for (final Activity activity in activities) {
index += 1;
await activity.autoTagger(athlete: athlete);
flushbar.dismiss();
await flushbar.dismiss();
percent = 100 * index ~/ activities.length;
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: percent / 100),
......@@ -42,7 +42,7 @@ Future<void> autoTagging({
)..show(context);
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Autotaggings are now up to date.',
duration: const Duration(seconds: 5),
......
......@@ -10,7 +10,7 @@ Future<void> downloadActivity({
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download .fit-File for »${activity.name}«',
duration: const Duration(seconds: 10),
......@@ -19,7 +19,7 @@ Future<void> downloadActivity({
await activity.download(athlete: athlete);
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 2),
......
......@@ -39,7 +39,7 @@ Future<void> downloadDemoData({
await activity.setState('downloaded');
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Downloading demo data finished',
duration: const Duration(seconds: 2),
......@@ -59,14 +59,14 @@ Future<void> downloadDemoData({
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Activities imported!',
duration: const Duration(seconds: 5),
icon: MyIcon.finishedWhite,
)..show(context);
} else {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message:
'Please set up Power Zone Schema and Heart Rate Zone Schema first!',
......
......@@ -37,7 +37,7 @@ Future<void> importActivitiesLocally({
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Activities imported!',
duration: const Duration(seconds: 5),
......
......@@ -9,7 +9,7 @@ Future<void> parseActivity({
@required Athlete athlete,
@required Flushbar<Object> flushbar,
}) async {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: '0% of storing »${activity.name}«',
duration: const Duration(seconds: 10),
......@@ -19,7 +19,7 @@ Future<void> parseActivity({
final Stream<int> percentageStream = activity.parse(athlete: athlete);
await for (final int value in percentageStream) {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${activity.name}«',
......@@ -27,5 +27,5 @@ Future<void> parseActivity({
animationDuration: const Duration(milliseconds: 1),
)..show(context);
}
flushbar.dismiss();
await flushbar.dismiss();
}
......@@ -15,7 +15,7 @@ Future<void> queryStrava({
icon: MyIcon.stravaDownloadWhite,
)..show(context);
await Activity.queryStrava(athlete: athlete);
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 1),
......
......@@ -44,7 +44,7 @@ Future<void> updateJob({
);
await activity.autoTagger(athlete: athlete);
}
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'You are now up to date!',
duration: const Duration(seconds: 5),
......
......@@ -194,7 +194,7 @@ class _EditAthleteScreenState extends State<EditAthleteScreen> {
duration: const Duration(seconds: 10),
)..show(context);
if (await StravaFitDownload.credentialsAreValid(athlete: widget.athlete)) {
flushbar.dismiss();
await flushbar.dismiss();
Navigator.of(context).pop();
} else
flushbar = Flushbar<Object>(
......
......@@ -102,7 +102,7 @@ class _OnBoardingStravaCredentialsScreenState
duration: const Duration(seconds: 10),
)..show(context);
if (await StravaFitDownload.credentialsAreValid(athlete: widget.athlete)) {
flushbar.dismiss();
await flushbar.dismiss();
Navigator.of(context).pop();
} else
flushbar = Flushbar<Object>(
......
......@@ -344,7 +344,7 @@ class _ShowActivityScreenState extends State<ShowActivityScreen> {
await widget.activity.autoTagger(athlete: widget.athlete);
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Autotagging finished',
duration: const Duration(seconds: 2),
......@@ -367,7 +367,7 @@ class _ShowActivityScreenState extends State<ShowActivityScreen> {
await widget.activity.download(athlete: widget.athlete);
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 1),
......@@ -388,7 +388,7 @@ class _ShowActivityScreenState extends State<ShowActivityScreen> {
final Stream<int> percentageStream =
widget.activity.parse(athlete: widget.athlete);
await for (final int value in percentageStream) {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${widget.activity.name}«',
......
......@@ -81,7 +81,7 @@ class _ActivitiesListWidgetState extends State<ActivitiesListWidget> {
await activity.download(athlete: widget.athlete);
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
message: 'Download finished',
duration: const Duration(seconds: 1),
......@@ -102,7 +102,7 @@ class _ActivitiesListWidgetState extends State<ActivitiesListWidget> {
final Stream<int> percentageStream =
activity.parse(athlete: widget.athlete);
await for (final int value in percentageStream) {
flushbar.dismiss();
await flushbar.dismiss();
flushbar = Flushbar<Object>(
titleText: LinearProgressIndicator(value: value / 100),
message: '$value% of storing »${activity.name}«',
......
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