feat: enhance recipe ingredient model; add raw fields and optional properties for better ingredient handling
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:
@@ -396,6 +396,10 @@ class _RecipeBody extends StatelessWidget {
|
||||
const SizedBox(height: 12),
|
||||
...recipe.ingredients.map((ing) {
|
||||
final qtyStr = ing.quantity == 0 ? '' : _fmtQty(ing.quantity);
|
||||
final ingredientLabel = (ing.rawName.trim().isNotEmpty
|
||||
? ing.rawName
|
||||
: (ing.productName ?? '').trim())
|
||||
.trim();
|
||||
final measureParts = [
|
||||
if (qtyStr.isNotEmpty) qtyStr,
|
||||
if (ing.unit.isNotEmpty) ing.unit,
|
||||
@@ -430,8 +434,8 @@ class _RecipeBody extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
ing.note != null
|
||||
? '${ing.productName} (${ing.note})'
|
||||
: ing.productName,
|
||||
? '$ingredientLabel (${ing.note})'
|
||||
: ingredientLabel,
|
||||
style: theme.textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user