qy_commodity_info.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. class QYCommodityInfo {
  2. String? commodityInfoTitle;
  3. String? commodityInfoDesc;
  4. String? pictureUrl;
  5. String? commodityInfoUrl;
  6. String? note;
  7. bool? show;
  8. bool? sendByUser;
  9. QYCommodityInfo({
  10. this.commodityInfoTitle,
  11. this.commodityInfoDesc,
  12. this.pictureUrl,
  13. this.commodityInfoUrl,
  14. this.note,
  15. this.show,
  16. this.sendByUser,
  17. });
  18. factory QYCommodityInfo.fromJson(Map<String, dynamic> json) {
  19. return QYCommodityInfo(
  20. commodityInfoTitle: json['commodityInfoTitle'],
  21. commodityInfoDesc: json['commodityInfoDesc'],
  22. pictureUrl: json['pictureUrl'],
  23. commodityInfoUrl: json['commodityInfoUrl'],
  24. note: json['note'],
  25. show: json['show'],
  26. sendByUser: json['sendByUser'],
  27. );
  28. }
  29. Map<String, dynamic> toJson() {
  30. Map<String, dynamic> json = new Map();
  31. if (commodityInfoTitle != null)
  32. json.putIfAbsent('commodityInfoTitle', () => commodityInfoTitle);
  33. if (commodityInfoDesc != null)
  34. json.putIfAbsent('commodityInfoDesc', () => commodityInfoDesc);
  35. if (pictureUrl != null) json.putIfAbsent('pictureUrl', () => pictureUrl);
  36. if (commodityInfoUrl != null)
  37. json.putIfAbsent('commodityInfoUrl', () => commodityInfoUrl);
  38. if (note != null) json.putIfAbsent('note', () => note);
  39. if (show != null) json.putIfAbsent('show', () => show);
  40. if (sendByUser != null) json.putIfAbsent('sendByUser', () => sendByUser);
  41. return json;
  42. }
  43. }