class FoodScanDto { int? id; String? foodName; String? foodDesc; List? ingredientsList; String? explanation; String? suggestions; List? healthConcernsList; int? foodType; String? imageUrl; FoodScanDto({ this.id, this.foodName, this.foodDesc, this.ingredientsList, this.explanation, this.suggestions, this.healthConcernsList, this.foodType, this.imageUrl, }); Map toJson() { final map = {}; map["id"] = id; map["food_name"] = foodName; map["food_desc"] = foodDesc; map["ingredients"] = ingredientsList; map["explanation"] = explanation; map["suggestions"] = suggestions; map["health_concerns"] = healthConcernsList; map["food_type"] = foodType; map["image_url"] = imageUrl; return map; } FoodScanDto.fromJson(dynamic json) { id = json["id"] ?? 0; foodName = json["food_name"] ?? ""; foodDesc = json["food_desc"] ?? ""; ingredientsList = json["ingredients"] != null ? json["ingredients"].cast() : []; explanation = json["explanation"] ?? ""; suggestions = json["suggestions"] ?? ""; healthConcernsList = json["health_concerns"] != null ? json["health_concerns"].cast() : []; foodType = json["food_type"] ?? 0; imageUrl = json["image_url"] ?? ""; } }