Skip to content

Commit

Permalink
feat: add toast when saving and exit builder (implements #47)
Browse files Browse the repository at this point in the history
  • Loading branch information
blockbasti committed Apr 28, 2021
1 parent 1c1b3f3 commit 8c6094e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/workout_builder.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';

import 'generated/l10n.dart';
import 'number_stepper.dart';
Expand Down Expand Up @@ -105,10 +106,12 @@ class _BuilderPageState extends State<BuilderPage> {
} else {
writeWorkout(_workout);
_newWorkout = false;
Fluttertoast.showToast(
msg: "Saved",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER);
}
setState(() {
_dirty = false;
});
Navigator.of(context).pop(true);
}

void _addExercise(int setIndex, bool isRest) {
Expand Down
9 changes: 8 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
fluttertoast:
dependency: "direct main"
description:
name: fluttertoast
url: "https://pub.dartlang.org"
source: hosted
version: "7.1.8"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -293,7 +300,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.27"
version: "1.6.28"
path_provider_linux:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
flutter_tts:
path_provider:
shared_preferences:
fluttertoast:
preferences:
url_launcher:
wakelock:
Expand Down

0 comments on commit 8c6094e

Please sign in to comment.