mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
put popup button also in preview section
This commit is contained in:
@@ -367,7 +367,6 @@ class IngredientFormState extends State<IngredientForm> {
|
||||
) {
|
||||
if (snapshot.hasData) {
|
||||
_mealItem.ingredient = snapshot.data!;
|
||||
// here it could be nice to put the button to the popup
|
||||
return MealItemValuesTile(
|
||||
ingredient: _mealItem.ingredient,
|
||||
nutritionalValues: _mealItem.nutritionalValues,
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:wger/widgets/nutrition/nutrition_tile.dart';
|
||||
import 'package:wger/widgets/nutrition/widgets.dart';
|
||||
|
||||
/// a NutritionTitle showing an ingredient, with its
|
||||
/// avatar and nutritional values
|
||||
/// avatar, nutritional values and button to popup its details
|
||||
class MealItemValuesTile extends StatelessWidget {
|
||||
final Ingredient ingredient;
|
||||
final NutritionalValues nutritionalValues;
|
||||
@@ -29,6 +29,16 @@ class MealItemValuesTile extends StatelessWidget {
|
||||
return NutritionTile(
|
||||
leading: IngredientAvatar(ingredient: ingredient),
|
||||
title: Text(getShortNutritionValues(nutritionalValues, context)),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.info_outline),
|
||||
onPressed: () {
|
||||
showIngredientDetails(
|
||||
context,
|
||||
ingredient.id,
|
||||
image: ingredient.image?.image,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user