NutritionLog class
Holds information about food logged by a user.
There are two ways of creating a nutrition log based on the food type: 1.
Identified food: Using the food field, which is a reference to a Food
resource. In this case fields nutrients, energy, energy_from_fat,
total_carbohydrate, total_fat, food_display_name will be populated
based on the referenced food. 2. Anonymous food: Using the
food_display_name field and setting the nutrients, energy,
energy_from_fat, total_carbohydrate, total_fat fields manually. The
identified food is preferred over the anonymous food. Nutrition logs created
from anonymous food are not editable.
Constructors
-
NutritionLog({EnergyQuantity? energy, EnergyQuantity? energyFromFat, String? food, String? foodDisplayName, SessionTimeInterval? interval, String? mealType, List<
NutrientQuantity> ? nutrients, Serving? serving, WeightQuantity? totalCarbohydrate, WeightQuantity? totalFat}) - NutritionLog.fromJson(Map json_)
Properties
- energy ↔ EnergyQuantity?
-
The total energy of the food, measured in kilocalories (
kcal).getter/setter pair - energyFromFat ↔ EnergyQuantity?
-
The energy from fat, measured in kilocalories (
kcal).getter/setter pair - food ↔ String?
-
The resource name of the Food item.
getter/setter pair
- foodDisplayName ↔ String?
-
The display name of the food.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval ↔ SessionTimeInterval?
-
The time window when the food was logged.
getter/setter pair
- mealType ↔ String?
-
The meal category.
getter/setter pair
-
nutrients
↔ List<
NutrientQuantity> ? -
An array of individual nutrient values for the nutrition log.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serving ↔ Serving?
-
The serving information for the logged food.
getter/setter pair
- totalCarbohydrate ↔ WeightQuantity?
-
The total carbohydrate content, measured in grams.
getter/setter pair
- totalFat ↔ WeightQuantity?
-
The total fat content, measured in grams.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited