certificate_item.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class CertificateItem {
  2. String id;
  3. int ownerId;
  4. String code;
  5. String issuanceAgency;
  6. String expirationDate;
  7. String certificateType;
  8. String firstImgUrl;
  9. String secondImgUrl;
  10. int status;
  11. CertificateItem({
  12. this.id = "",
  13. this.ownerId = 0,
  14. this.code = "",
  15. this.issuanceAgency = "",
  16. this.expirationDate = "",
  17. this.certificateType = "",
  18. this.firstImgUrl = "",
  19. this.secondImgUrl = "",
  20. this.status = 0
  21. });
  22. CertificateItem.fromJsonMap(Map<String, dynamic> map):
  23. id = map["id"],
  24. // ownerId = map["ownerId"],
  25. code = map["code"]??"",
  26. issuanceAgency = map["issuanceAgency"]??"",
  27. expirationDate = map["expirationDate"]??"",
  28. certificateType = map["certificateType"]??"",
  29. firstImgUrl = map["firstImgUrl"]??"",
  30. secondImgUrl = map["secondImgUrl"]??"",
  31. status = map["status"];
  32. Map<String, dynamic> toJson() {
  33. final Map<String, dynamic> data = new Map<String, dynamic>();
  34. data['id'] = id;
  35. data['ownerId'] = ownerId;
  36. data['code'] = code;
  37. data['issuanceAgency'] = issuanceAgency;
  38. data['expirationDate'] = expirationDate;
  39. data['certificateType'] = certificateType;
  40. data['firstImgUrl'] = firstImgUrl;
  41. data['secondImgUrl'] = secondImgUrl;
  42. data['status'] = status;
  43. return data;
  44. }
  45. }