NutrimentsHelper class




hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Methods

calculateEnergy(Nutriments nutriments) double
get the energy value converted in kJ if necessary. Removed as now energy is always in kJ calculates the energy for 100g in kJ. ! should be used cautiously (might not be displayed to the end user) ! source :
checkEnergyCoherence(Nutriments nutriments, double marginPercentage) bool
check if the stated energy value is within a margin of error a use case for this is before saving a product, check if the values aren't uncoherent.
getEnergyAsKCal(Nutriments nutriments) double
normalize the energy unit as it is pretty fragmented. Removed as now energy is always in kJ get the energy value converted in kCal.