mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-06 07:54:02 +01:00
Provide feedback after logging a meal
This commit is contained in:
1 parent
5a80807e8e
commit
70f55dfa48
2 files changed
+16
No files matched your search
@@ -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',
|
||||
|
||||
@@ -234,6 +234,14 @@ class DismissibleMealHeader extends StatelessWidget {
|
||||
// Log meal
|
||||
} else {
|
||||
Provider.of<Nutrition>(context, listen: false).logMealToDiary(_meal);
|
||||
Scaffold.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context).mealLogged,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user