Skip to content

Commit 4a87c0b

Browse files
committed
put popup button also in preview section
1 parent 1ae3f33 commit 4a87c0b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/widgets/nutrition/forms.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ class IngredientFormState extends State<IngredientForm> {
367367
) {
368368
if (snapshot.hasData) {
369369
_mealItem.ingredient = snapshot.data!;
370-
// here it could be nice to put the button to the popup
371370
return MealItemValuesTile(
372371
ingredient: _mealItem.ingredient,
373372
nutritionalValues: _mealItem.nutritionalValues,

lib/widgets/nutrition/nutrition_tiles.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:wger/widgets/nutrition/nutrition_tile.dart';
1313
import 'package:wger/widgets/nutrition/widgets.dart';
1414

1515
/// a NutritionTitle showing an ingredient, with its
16-
/// avatar and nutritional values
16+
/// avatar, nutritional values and button to popup its details
1717
class MealItemValuesTile extends StatelessWidget {
1818
final Ingredient ingredient;
1919
final NutritionalValues nutritionalValues;
@@ -29,6 +29,16 @@ class MealItemValuesTile extends StatelessWidget {
2929
return NutritionTile(
3030
leading: IngredientAvatar(ingredient: ingredient),
3131
title: Text(getShortNutritionValues(nutritionalValues, context)),
32+
trailing: IconButton(
33+
icon: const Icon(Icons.info_outline),
34+
onPressed: () {
35+
showIngredientDetails(
36+
context,
37+
ingredient.id,
38+
image: ingredient.image?.image,
39+
);
40+
},
41+
),
3242
);
3343
}
3444
}

0 commit comments

Comments
 (0)