class CertificateItem { String id; int ownerId; String code; String issuanceAgency; String expirationDate; String certificateType; String firstImgUrl; String secondImgUrl; int status; CertificateItem({ this.id = "", this.ownerId = 0, this.code = "", this.issuanceAgency = "", this.expirationDate = "", this.certificateType = "", this.firstImgUrl = "", this.secondImgUrl = "", this.status = 0 }); CertificateItem.fromJsonMap(Map map): id = map["id"], // ownerId = map["ownerId"], code = map["code"]??"", issuanceAgency = map["issuanceAgency"]??"", expirationDate = map["expirationDate"]??"", certificateType = map["certificateType"]??"", firstImgUrl = map["firstImgUrl"]??"", secondImgUrl = map["secondImgUrl"]??"", status = map["status"]; Map toJson() { final Map data = new Map(); data['id'] = id; data['ownerId'] = ownerId; data['code'] = code; data['issuanceAgency'] = issuanceAgency; data['expirationDate'] = expirationDate; data['certificateType'] = certificateType; data['firstImgUrl'] = firstImgUrl; data['secondImgUrl'] = secondImgUrl; data['status'] = status; return data; } }