FoodRecordIngredient class

Represents an ingredient of a food record.

Constructors

FoodRecordIngredient.fromFoodRecord(FoodRecord foodRecord, {PassioIDEntityType entityType = PassioIDEntityType.item})
Factory constructor to create a FoodRecordIngredient from a FoodRecord instance.
factory
FoodRecordIngredient.fromJson(Map<String, dynamic> json)
Creates a FoodRecordIngredient instance from a JSON object.
factory
FoodRecordIngredient.fromPassioIngredient(PassioIngredient ingredient, {PassioIDEntityType entityType = PassioIDEntityType.item})
Factory constructor to create a FoodRecordIngredient from a PassioIngredient instance.
factory

Properties

computedWeight UnitMass
computedWeight is UnitMass class and contains weight.
no setter
entityType PassioIDEntityType
Type of Passio ID entity.
getter/setter pair
hashCode int
Overrides the hashCode method.
no setteroverride
iconId String
Identifier for the icon of the ingredient.
getter/setter pair
id String
Unique identifier for the ingredient.
getter/setter pair
name String
Name of the ingredient.
getter/setter pair
openFoodLicense String?
License information for open food data.
getter/setter pair
passioID String
Passio identifier for the food record.
getter/setter pair
refCode String
A reference code serving as a unique identifier for the food item.
getter/setter pair
referenceNutrients PassioNutrients
Nutritional information of the ingredient.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedQuantity double
Quantity of the ingredient.
getter/setter pair
selectedUnit String
Currently selected unit for measurement.
getter/setter pair
servingSizes List<PassioServingSize>
Available serving sizes for the ingredient.
getter/setter pair
servingUnits List<PassioServingUnit>
Available serving units for the ingredient.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nutrientsReference() PassioNutrients
Retrieves the reference nutrients of the ingredient.
nutrientsSelectedSize() PassioNutrients
Calculates the nutritional information for the selected serving size based on the reference nutrients.
servingWeight() UnitMass
Calculates the serving weight of the ingredient based on the selected unit and quantity.
toJson() Map<String, dynamic>
Converts the FoodRecordIngredient instance to a JSON object.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Overrides the equality operator.
override