NutritionContainer class Null safety

Nutrition data, for nutrient order and conversions.

Constructors

NutritionContainer({required dynamic orderedNutrients, required dynamic product})

Properties

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
servingSize String?
read-only

Methods

add(dynamic orderedNutrient) → void
To be used when an OrderedNutrient is added to the input list
getDisplayableNutrients() Iterable
Returns the interesting nutrients that need to be displayed.
getLeftoverNutrients() Iterable
Returns the not interesting nutrients, for a "Please add me!" list.
getProduct() → dynamic
Returns a Product with only nutrients data.
getUnit(String nutrientId) → dynamic
Returns the nutrient Unit, after possible alterations.
getValue(String valueKey) double?
Returns the stored product nutrient's value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setControllerText(String controllerKey, String text) → void
Stores the text from the end-user input.
setNextWeightUnit(dynamic orderedNutrient) → void
Typical use-case: Unit button action.
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

getValueKey(String nutrientId, bool perServing) String
Returns the Nutriments map key for the nutrient value. [...]
isEditableWeight(dynamic orderedNutrient) bool
Typical use-case: should we make the Unit button clickable?

Constants

fakeNutrientIdServingSize → const String
'_servingSize'