Nutriments class
Values in nutrients.
- Inheritance
-
- Object
- JsonObject
- Nutriments
Constructors
- Nutriments.empty()
- Empty nutrient map.
-
Nutriments.fromJson(Map<
String, dynamic> json) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getComputedKJ(
PerSize perSize) → double? -
Returns the energy in kJ for that
perSize
, direct or computed from kcal. -
getValue(
Nutrient nutrient, PerSize perSize) → double? -
Returns the value in grams of that
nutrient
for 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) → Nutriments -
Sets the value in grams of that
nutrient
for thatperSize
. -
toData(
) → Map< String, String> -
inherited
-
toJson(
) → Map< String, dynamic> -
Returns a JSON version of the Nutriments.
override
-
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>