fromJson method
Implementation
TraceabilityIngredient fromJson(Map<String, dynamic> json) {
try {
id = Util.isNullFromJson(json, 'id') ? json['id'] : -1;
traceability_id = Util.isNullFromJson(json, 'traceability_id') ? json['traceability_id'] : 0;
ingredient_name = Util.isNullFromJson(json, 'ingredient_name') ? json['ingredient_name'] : '';
ingredient_quantily = Util.isNullFromJson(json, 'ingredient_quantily') ? json['ingredient_quantily'].toString() : '';
created_at = Util.isNullFromJson(json, 'created_at') ? json['created_at'] : '';
ingredient_note = Util.isNullFromJson(json, 'ingredient_note') ? json['ingredient_note'] : '';
manufacture_phone = Util.isNullFromJson(json, 'manufacture_phone') ? json['manufacture_phone'] : '';
manufacture_name = Util.isNullFromJson(json, 'manufacture_name') ? json['manufacture_name'] : '';
manufacture_address = Util.isNullFromJson(json, 'manufacture_address') ? json['manufacture_address'] : '';
manufacture_email = Util.isNullFromJson(json, 'manufacture_email') ? json['manufacture_email'] : '';
updated_at = Util.isNullFromJson(json, 'updated_at') ? json['updated_at'] : '';
traceability_type = Util.isNullFromJson(json, 'traceability_type') ? json['traceability_type'] : '';
land_area = Util.isNullFromJson(json, 'land_area') ? json['land_area'].toString() : '';
ingredient_address = Util.isNullFromJson(json, 'ingredient_address') ? json['ingredient_address'] : '';
if (Util.isNullFromJson(json, 'images')) images.fromJson(json['images']);
} catch (e) {
return TraceabilityIngredient();
}
return this;
}