Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -646,6 +646,9 @@ class _IngredientPreviewRow extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final cs = theme.colorScheme;
|
||||
final label = ingredient.productName.trim().isEmpty
|
||||
? 'Okänd ingrediens'
|
||||
: ingredient.productName;
|
||||
|
||||
final (icon, color) = ingredient.fromPantry
|
||||
? (Icons.kitchen_outlined, cs.secondary)
|
||||
@@ -687,7 +690,7 @@ class _IngredientPreviewRow extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${ingredient.productName}'
|
||||
'$label'
|
||||
'${ingredient.note != null ? ' (${ingredient.note})' : ''}'
|
||||
' – $requiredStr',
|
||||
style: theme.textTheme.bodyMedium,
|
||||
|
||||
Reference in New Issue
Block a user