mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-29 17:31:01 +01:00
feat: displays brand name underneath title in ingredient details
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user