From 70f55dfa48b74b1f2c78b496b63807af3760089c Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 1 Feb 2021 22:17:13 +0100 Subject: [PATCH] Provide feedback after logging a meal --- lib/locale/locales.dart | 8 ++++++++ lib/widgets/nutrition/meal.dart | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/locale/locales.dart b/lib/locale/locales.dart index 86050d2c5..cfcba218b 100644 --- a/lib/locale/locales.dart +++ b/lib/locale/locales.dart @@ -123,6 +123,14 @@ class AppLocalizations { ); } + String get mealLogged { + return Intl.message( + 'Meal was successfully logged to diary', + name: 'mealLogged', + desc: 'Info message after logging a meal', + ); + } + String get addIngredient { return Intl.message( 'Add ingredient', diff --git a/lib/widgets/nutrition/meal.dart b/lib/widgets/nutrition/meal.dart index 32c0cdbeb..c10814096 100644 --- a/lib/widgets/nutrition/meal.dart +++ b/lib/widgets/nutrition/meal.dart @@ -234,6 +234,14 @@ class DismissibleMealHeader extends StatelessWidget { // Log meal } else { Provider.of(context, listen: false).logMealToDiary(_meal); + Scaffold.of(context).showSnackBar( + SnackBar( + content: Text( + AppLocalizations.of(context).mealLogged, + textAlign: TextAlign.center, + ), + ), + ); } return false; },