NutritionHealthValue class

A HealthValue object for nutrition.

Parameters:

  • protein - the amount of protein in grams
  • calories - the amount of calories in kcal
  • fat - the amount of fat in grams
  • name - the name of the food
  • carbs - the amount of carbs in grams
  • caffeine - the amount of caffeine in grams
  • mealType - the type of meal
Inheritance
Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

NutritionHealthValue({String? mealType, double? protein, double? calories, double? fat, String? name, double? carbs, double? caffeine})
NutritionHealthValue.fromHealthDataPoint(dynamic dataPoint)
Create a NutritionHealthValue based on a health data point from native data format.
factory
NutritionHealthValue.fromJson(Map<String, dynamic> json)
factory

Properties

$type String?
The runtime class name (type) of this object. Used for deserialization from JSON objects.
getter/setter pairinherited
caffeine double?
The amount of caffeine in grams.
getter/setter pair
calories double?
The amount of calories in kcal.
getter/setter pair
carbs double?
The amount of carbs in grams.
getter/setter pair
fat double?
The amount of fat in grams.
getter/setter pair
fromJsonFunction Function
The function which can convert a JSON string to an object of this type.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
jsonType String
Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.
no setterinherited
mealType String?
The type of meal.
getter/setter pair
name String?
The name of the food.
getter/setter pair
protein double?
The amount of protein in grams.
getter/setter pair
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>
Return a JSON encoding of this object.
override
toString() String
A string representation of this object.
override

Operators

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