class RawMaterialResponse { RawMaterialResponse({ required this.data, }); List data; factory RawMaterialResponse.fromJson(Map json) => RawMaterialResponse( data: List.from( json["data"].map((x) => RawMaterial.fromJson(x)))); } class RawMaterial { int id; String name; dynamic category; RawMaterial({ required this.id, required this.name, this.category, }); factory RawMaterial.fromJson(Map json) => RawMaterial( id: json["id"], name: json["name"], category: json["category"], ); } class RekomendasiResepResponse { List rekomendasiResep; RekomendasiResepResponse({ required this.rekomendasiResep, }); factory RekomendasiResepResponse.fromJson(Map json) => RekomendasiResepResponse( rekomendasiResep: List.from( json["data"].map((x) => RekomendasiResep.fromJson(x))), ); } class RekomendasiResep { int id; String title; String imageUrl; String difficulty; String sourceUrl; int calories; double completenessPercentage; bool isFavorited; Rating rating; RekomendasiResep({ required this.id, required this.title, required this.imageUrl, required this.difficulty, required this.sourceUrl, required this.calories, required this.completenessPercentage, required this.isFavorited, required this.rating, }); factory RekomendasiResep.fromJson(Map json) => RekomendasiResep( id: json["id"], title: json["title"], imageUrl: json["image_url"], difficulty: json["difficulty"], sourceUrl: json["source_url"], calories: json["calories"], completenessPercentage: json["completeness_percentage"], isFavorited: json["is_favorited"], rating: Rating.fromJson(json["rating"]), ); Map toJson() => { "id": id, "title": title, "image_url": imageUrl, "difficulty": difficulty, "source_url": sourceUrl, "calories": calories, "completeness_percentage": completenessPercentage, "is_favorited": isFavorited, "rating": rating.toJson(), }; } class Rating { double score; int amount; Rating({ required this.score, required this.amount, }); factory Rating.fromJson(Map json) => Rating( score: json["score"], amount: json["amount"], ); Map toJson() => { "score": score, "amount": amount, }; } class EnumValues { Map map; late Map reverseMap; EnumValues(this.map); Map get reverse { reverseMap = map.map((k, v) => MapEntry(v, k)); return reverseMap; } }