Nutrition.fromJson constructor
Nutrition.fromJson(
- Map json_
Implementation
Nutrition.fromJson(core.Map json_)
: this(
addedSugars: json_.containsKey('addedSugars')
? FloatUnit.fromJson(
json_['addedSugars'] as core.Map<core.String, core.dynamic>)
: null,
addedSugarsDailyPercentage:
json_.containsKey('addedSugarsDailyPercentage')
? (json_['addedSugarsDailyPercentage'] as core.num).toDouble()
: null,
calcium: json_.containsKey('calcium')
? FloatUnit.fromJson(
json_['calcium'] as core.Map<core.String, core.dynamic>)
: null,
calciumDailyPercentage: json_.containsKey('calciumDailyPercentage')
? (json_['calciumDailyPercentage'] as core.num).toDouble()
: null,
cholesterol: json_.containsKey('cholesterol')
? FloatUnit.fromJson(
json_['cholesterol'] as core.Map<core.String, core.dynamic>)
: null,
cholesterolDailyPercentage:
json_.containsKey('cholesterolDailyPercentage')
? (json_['cholesterolDailyPercentage'] as core.num).toDouble()
: null,
dietaryFiber: json_.containsKey('dietaryFiber')
? FloatUnit.fromJson(
json_['dietaryFiber'] as core.Map<core.String, core.dynamic>)
: null,
dietaryFiberDailyPercentage: json_
.containsKey('dietaryFiberDailyPercentage')
? (json_['dietaryFiberDailyPercentage'] as core.num).toDouble()
: null,
energy: json_.containsKey('energy')
? FloatUnit.fromJson(
json_['energy'] as core.Map<core.String, core.dynamic>)
: null,
energyFromFat: json_.containsKey('energyFromFat')
? FloatUnit.fromJson(
json_['energyFromFat'] as core.Map<core.String, core.dynamic>)
: null,
folateDailyPercentage: json_.containsKey('folateDailyPercentage')
? (json_['folateDailyPercentage'] as core.num).toDouble()
: null,
folateFolicAcid: json_.containsKey('folateFolicAcid')
? FloatUnit.fromJson(json_['folateFolicAcid']
as core.Map<core.String, core.dynamic>)
: null,
folateMcgDfe: json_.containsKey('folateMcgDfe')
? (json_['folateMcgDfe'] as core.num).toDouble()
: null,
iron: json_.containsKey('iron')
? FloatUnit.fromJson(
json_['iron'] as core.Map<core.String, core.dynamic>)
: null,
ironDailyPercentage: json_.containsKey('ironDailyPercentage')
? (json_['ironDailyPercentage'] as core.num).toDouble()
: null,
monounsaturatedFat: json_.containsKey('monounsaturatedFat')
? FloatUnit.fromJson(json_['monounsaturatedFat']
as core.Map<core.String, core.dynamic>)
: null,
nutritionFactMeasure: json_.containsKey('nutritionFactMeasure')
? json_['nutritionFactMeasure'] as core.String
: null,
polyols: json_.containsKey('polyols')
? FloatUnit.fromJson(
json_['polyols'] as core.Map<core.String, core.dynamic>)
: null,
polyunsaturatedFat: json_.containsKey('polyunsaturatedFat')
? FloatUnit.fromJson(json_['polyunsaturatedFat']
as core.Map<core.String, core.dynamic>)
: null,
potassium: json_.containsKey('potassium')
? FloatUnit.fromJson(
json_['potassium'] as core.Map<core.String, core.dynamic>)
: null,
potassiumDailyPercentage:
json_.containsKey('potassiumDailyPercentage')
? (json_['potassiumDailyPercentage'] as core.num).toDouble()
: null,
preparedSizeDescription: json_.containsKey('preparedSizeDescription')
? json_['preparedSizeDescription'] as core.String
: null,
protein: json_.containsKey('protein')
? FloatUnit.fromJson(
json_['protein'] as core.Map<core.String, core.dynamic>)
: null,
proteinDailyPercentage: json_.containsKey('proteinDailyPercentage')
? (json_['proteinDailyPercentage'] as core.num).toDouble()
: null,
saturatedFat: json_.containsKey('saturatedFat')
? FloatUnit.fromJson(
json_['saturatedFat'] as core.Map<core.String, core.dynamic>)
: null,
saturatedFatDailyPercentage: json_
.containsKey('saturatedFatDailyPercentage')
? (json_['saturatedFatDailyPercentage'] as core.num).toDouble()
: null,
servingSizeDescription: json_.containsKey('servingSizeDescription')
? json_['servingSizeDescription'] as core.String
: null,
servingSizeMeasure: json_.containsKey('servingSizeMeasure')
? FloatUnit.fromJson(json_['servingSizeMeasure']
as core.Map<core.String, core.dynamic>)
: null,
servingsPerContainer: json_.containsKey('servingsPerContainer')
? json_['servingsPerContainer'] as core.String
: null,
sodium: json_.containsKey('sodium')
? FloatUnit.fromJson(
json_['sodium'] as core.Map<core.String, core.dynamic>)
: null,
sodiumDailyPercentage: json_.containsKey('sodiumDailyPercentage')
? (json_['sodiumDailyPercentage'] as core.num).toDouble()
: null,
starch: json_.containsKey('starch')
? FloatUnit.fromJson(
json_['starch'] as core.Map<core.String, core.dynamic>)
: null,
totalCarbohydrate: json_.containsKey('totalCarbohydrate')
? FloatUnit.fromJson(json_['totalCarbohydrate']
as core.Map<core.String, core.dynamic>)
: null,
totalCarbohydrateDailyPercentage:
json_.containsKey('totalCarbohydrateDailyPercentage')
? (json_['totalCarbohydrateDailyPercentage'] as core.num)
.toDouble()
: null,
totalFat: json_.containsKey('totalFat')
? FloatUnit.fromJson(
json_['totalFat'] as core.Map<core.String, core.dynamic>)
: null,
totalFatDailyPercentage: json_.containsKey('totalFatDailyPercentage')
? (json_['totalFatDailyPercentage'] as core.num).toDouble()
: null,
totalSugars: json_.containsKey('totalSugars')
? FloatUnit.fromJson(
json_['totalSugars'] as core.Map<core.String, core.dynamic>)
: null,
totalSugarsDailyPercentage:
json_.containsKey('totalSugarsDailyPercentage')
? (json_['totalSugarsDailyPercentage'] as core.num).toDouble()
: null,
transFat: json_.containsKey('transFat')
? FloatUnit.fromJson(
json_['transFat'] as core.Map<core.String, core.dynamic>)
: null,
transFatDailyPercentage: json_.containsKey('transFatDailyPercentage')
? (json_['transFatDailyPercentage'] as core.num).toDouble()
: null,
vitaminD: json_.containsKey('vitaminD')
? FloatUnit.fromJson(
json_['vitaminD'] as core.Map<core.String, core.dynamic>)
: null,
vitaminDDailyPercentage: json_.containsKey('vitaminDDailyPercentage')
? (json_['vitaminDDailyPercentage'] as core.num).toDouble()
: null,
voluntaryNutritionFact: json_.containsKey('voluntaryNutritionFact')
? (json_['voluntaryNutritionFact'] as core.List)
.map((value) => VoluntaryNutritionFact.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList()
: null,
);