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:
@@ -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?,
|
||||
|
||||
Reference in New Issue
Block a user