PassioFoodItemData class

Data class that contains the nutritional information for a single food item.

Constructors

PassioFoodItemData(PassioID passioID, String name, List<String>? tags, double selectedQuantity, String selectedUnit, PassioIDEntityType entityType, List<PassioServingUnit> servingUnits, List<PassioServingSize> servingSize, String? ingredientsDescription, Barcode? barcode, List<PassioFoodOrigin>? foodOrigins, List<PassioAlternative>? parents, List<PassioAlternative>? siblings, List<PassioAlternative>? children, UnitEnergy? _calories, UnitMass? _carbs, UnitMass? _fat, UnitMass? _proteins, UnitMass? _saturatedFat, UnitMass? _transFat, UnitMass? _monounsaturatedFat, UnitMass? _polyunsaturatedFat, UnitMass? _cholesterol, UnitMass? _sodium, UnitMass? _fibers, UnitMass? _sugars, UnitMass? _sugarsAdded, UnitMass? _vitaminD, UnitMass? _calcium, UnitMass? _iron, UnitMass? _potassium, UnitIU? _vitaminA, UnitMass? _vitaminC, UnitMass? _alcohol, UnitMass? _sugarAlcohol, UnitMass? _vitaminB12Added, UnitMass? _vitaminB12, UnitMass? _vitaminB6, UnitMass? _vitaminE, UnitMass? _vitaminEAdded, UnitMass? _magnesium, UnitMass? _phosphorus, UnitMass? _iodine)
Creates a new instance of PassioFoodItemData.
PassioFoodItemData.fromJson(Map<String, dynamic> json)
Creates a PassioFoodItemData instance from a JSON map.
factory

Properties

barcode Barcode?
Corresponding barcode code of the food item.
final
children List<PassioAlternative>?
List of PassioAlternatives that are one level below in the food hierarchy.
final
entityType PassioIDEntityType
Type of the food item.
final
foodOrigins List<PassioFoodOrigin>?
List of sources from which data on the food item is populated from.
final
hashCode int
The hash code for this object.
no setterinherited
ingredientsDescription String?
List of ingredients of the food item.
final
name String
Name of the single food item.
final
parents List<PassioAlternative>?
List of PassioAlternative that are one level above in the food hierarchy.
final
passioID PassioID
ID to query the nutritional database
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedQuantity double
Currently selected weight quantity.
getter/setter pair
selectedUnit String
Currently selected weight unit.
getter/setter pair
servingSize List<PassioServingSize>
List of predefined serving size from the nutritional database.
final
servingUnits List<PassioServingUnit>
List of predefined serving units from the nutritional database.
final
siblings List<PassioAlternative>?
List of PassioAlternatives that are on the same level the food hierarchy.
final
tags List<String>?
List of tags associated with the food item.
final

Methods

computedWeight() UnitMass
Computes the total weight of the food item.
isOpenFood() bool
Checks if the food item is sourced from OpenFood.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openFoodLicense() String?
Retrieves the OpenFood license associated with the food item.
setServingSize(String unit, double quantity) bool
Sets the serving size of the food item.
setServingUnitKeepWeight(String unit) bool
Sets the serving unit of the food item while keeping the weight constant.
toJson() Map<String, dynamic>
Converts the PassioFoodItemData instance to a JSON map.
toString() String
A string representation of this object.
inherited
totalAlcohol() UnitMass?
totalCalcium() UnitMass?
totalCalories() UnitEnergy?
totalCarbs() UnitMass?
totalCholesterol() UnitMass?
totalFat() UnitMass?
totalFibers() UnitMass?
totalIodine() UnitMass?
totalIron() UnitMass?
totalMagnesium() UnitMass?
totalMonounsaturatedFat() UnitMass?
totalPhosphorus() UnitMass?
totalPolyunsaturatedFat() UnitMass?
totalPotassium() UnitMass?
totalProteins() UnitMass?
totalSaturatedFat() UnitMass?
totalSodium() UnitMass?
totalSugarAlcohol() UnitMass?
totalSugars() UnitMass?
totalSugarsAdded() UnitMass?
totalTransFat() UnitMass?
totalVitaminA() UnitIU?
totalVitaminB12() UnitMass?
totalVitaminB12Added() UnitMass?
totalVitaminB6() UnitMass?
totalVitaminC() UnitMass?
totalVitaminD() UnitMass?
totalVitaminE() UnitMass?
totalVitaminEAdded() UnitMass?

Operators

operator ==(Object other) bool
The equality operator.
inherited