/// id : 6 /// category_id : 4 /// name : "KENT SILVER" /// ean : "46187413" /// articul : 1 /// price : 500 /// opt_price : 500 /// base_price : 500 /// divisible : 0 /// updated_at : "2021-02-03 11:37:34" class GoodResponse { int id; int categoryId; String name; String ean; int articul; int price; int optPrice; int basePrice; int divisible; String updatedAt; static GoodResponse fromMap(Map map) { if (map == null) return null; GoodResponse goodResponseBean = GoodResponse(); goodResponseBean.id = map['id']; goodResponseBean.categoryId = map['category_id']; goodResponseBean.name = map['name']; goodResponseBean.ean = map['ean']; goodResponseBean.articul = map['articul']; goodResponseBean.price = map['price']; goodResponseBean.optPrice = map['opt_price']; goodResponseBean.basePrice = map['base_price']; goodResponseBean.divisible = map['divisible']; goodResponseBean.updatedAt = map['updated_at']; return goodResponseBean; } Map toJson() => { "id": id, "category_id": categoryId, "name": name, "ean": ean, "articul": articul, "price": price, "opt_price": optPrice, "base_price": basePrice, "divisible": divisible, "updated_at": updatedAt, }; }