Nutriments class
Values in nutrients.
Most interesting methods are:
- Inheritance
-
- Object
- JsonObject
- JsonMap
- Nutriments
Constructors
- Nutriments.empty()
- Empty nutrient map.
-
Nutriments.fromJson(Map<
String, dynamic> json) -
factory
Properties
Methods
-
asSaveProductMap(
) → Map< String, String> - Transform the nutriments into a useful map for saving a product.
-
deleteValue(
Nutrient nutrient, PerSize perSize) → Nutriments -
Deletes the value in grams of that
nutrientfor thatperSize. -
getComputedKJ(
PerSize perSize) → double? -
Returns the energy in kJ for that
perSize, direct or computed from kcal. -
getModifier(
Nutrient nutrient) → NutrientModifier? -
Returns the modifier of that
nutrient. -
getValue(
Nutrient nutrient, PerSize perSize) → double? -
Returns the value of that
nutrientfor thatperSize. -
isEmpty(
{bool isNullEmpty = false}) → 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, PerSize perSize, double? value, {NutrientModifier? modifier}) → Nutriments -
Sets the value in grams of that
nutrientfor thatperSize. -
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>