Nutriments class

Values in nutrients.

Most interesting methods are:

Inheritance

Constructors

Nutriments.empty()
Empty nutrient map.
Nutriments.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
jsonMap Map<String, dynamic>
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteValue(Nutrient nutrient) Nutriments
getComputedKJ(PerSize perSize) double?
Returns the energy in kJ for that perSize, direct or computed from kcal.
getComputedValue(Nutrient nutrient, PerSize perSize) double?
Returns the computed value of that nutrient for that perSize.
getModifier(Nutrient nutrient) NutrientModifier?
Returns the modifier of that nutrient.
getUnit(Nutrient nutrient) Unit?
Returns the unit of that nutrient.
getValue(Nutrient nutrient) double?
Returns the value of that nutrient.
isEmpty() bool
Returns true if there are no populated nutrients at all.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setValue(Nutrient nutrient, double value, {required Unit unit, NutrientModifier? modifier}) Nutriments
Sets the value, unit and possibly modifier of that nutrient.
setValueAsNotSpecified(Nutrient nutrient) Nutriments
toData() Map<String, String>
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited
toValueString() String
Returns all values as a String separated by a hyphen value1 - value2 - value3
inherited

Operators

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

Static Methods

toJsonHelper(Nutriments? n) Map<String, dynamic>