import 'dart:convert'; class NotOwnIngredientResponse { List bahanYangTidakDimiliki; NotOwnIngredientResponse({ required this.bahanYangTidakDimiliki, }); factory NotOwnIngredientResponse.fromJson(Map json) => NotOwnIngredientResponse( bahanYangTidakDimiliki: List.from( json["Bahan yang tidak dimiliki: "] .map((x) => BahanYangTidakDimiliki.fromJson(x))), ); Map toJson() => { "Bahan yang tidak dimiliki: ": List.from(bahanYangTidakDimiliki.map((x) => x.toJson())), }; } class BahanYangTidakDimiliki { int id; int recipeId; String name; double amount; dynamic unitId; String state; BahanYangTidakDimiliki({ required this.id, required this.recipeId, required this.name, required this.amount, required this.unitId, required this.state, }); factory BahanYangTidakDimiliki.fromJson(Map json) => BahanYangTidakDimiliki( id: json["id"], recipeId: json["recipe_id"], name: json["name"], amount: json["amount"]?.toDouble(), unitId: json["unit_id"], state: json["state"], ); Map toJson() => { "id": id, "recipe_id": recipeId, "name": name, "amount": amount, "unit_id": unitId, "state": state, }; }