feat: displays brand name underneath title in ingredient details

This commit is contained in:
Anja Klipic
2026-05-23 08:14:36 +02:00
parent 14577602ac
commit 8b5a381694
2 changed files with 17 additions and 2 deletions

View File

@@ -108,7 +108,22 @@ class IngredientDetails extends StatelessWidget {
}
return AlertDialog(
title: (snapshot.hasData) ? Text(ingredient!.name) : null,
title: snapshot.hasData
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(ingredient!.name),
if (ingredient.brand != null && ingredient.brand!.isNotEmpty)
Text(
ingredient.brand!,
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: DefaultTextStyle.of(context).style.color?.withValues(alpha: 0.6),
),
),
],
)
: null,
content: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),

View File

@@ -110,7 +110,7 @@ final milk = Ingredient(
id: 1,
code: '123456787',
name: 'Milk',
brand: 'null',
brand: null,
created: DateTime(2021, 5, 1),
energy: 500,
carbohydrates: 10,