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

This commit is contained in:
Nils-Johan Gynther
2026-05-06 07:25:42 +02:00
parent 612fcddb47
commit e4f201ea36
9 changed files with 349 additions and 267 deletions
@@ -19,6 +19,7 @@ class IngredientSuggestion {
class ParsedIngredient {
final String rawName;
final String? rawLine;
final double quantity;
final String unit;
final String? note;
@@ -27,6 +28,7 @@ class ParsedIngredient {
const ParsedIngredient({
required this.rawName,
this.rawLine,
required this.quantity,
required this.unit,
this.note,
@@ -38,6 +40,7 @@ class ParsedIngredient {
final rawSuggestions = json['suggestions'] as List<dynamic>? ?? [];
return ParsedIngredient(
rawName: json['rawName'] as String? ?? '',
rawLine: json['rawLine'] as String?,
quantity: (json['quantity'] as num? ?? 0).toDouble(),
unit: json['unit'] as String? ?? '',
note: json['note'] as String?,