PassioIngredient class
Represents an ingredient within a food item, including its amount, metadata, name, and reference nutrients.
Constructors
- PassioIngredient({required PassioFoodAmount amount, required String iconId, required String id, required PassioFoodMetadata metadata, required String name, required String refCode, required PassioNutrients referenceNutrients})
-
Creates a new
PassioIngredient
object.const -
PassioIngredient.fromJson(Map<
String, dynamic> json) -
Creates a
PassioIngredient
object from a JSON map.factory
Properties
- amount → PassioFoodAmount
-
The amount of the ingredient, including selected quantity and unit.
final
- hashCode → int
-
Calculates the hash code for this
PassioIngredient
object.no setteroverride - iconId → String
-
The ID of the icon associated with the ingredient.
final
- id → String
-
The unique identifier of the ingredient.
final
- metadata → PassioFoodMetadata
-
Additional metadata about the ingredient.
final
- name → String
-
The name of the ingredient.
final
- refCode → String
-
A reference code serving as a unique identifier for the ingredient.
final
- referenceNutrients → PassioNutrients
-
The reference nutrients of the ingredient, typically per 100 grams.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts the
PassioIngredient
object to a JSON map. -
toString(
) → String -
A string representation of this object.
inherited
-
weight(
) → UnitMass -
Calculates the weight of the ingredient by calling the
weight
method of itsamount
.
Operators
-
operator ==(
Object other) → bool -
Compares two
PassioIngredient
objects for equality.override