You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.5KB

  1. import 'CropPlot.dart';
  2. class TbCropDTO {
  3. int id;
  4. String qrCode;
  5. String code;
  6. num areaM2;
  7. int tbCropTypeId;
  8. String startDate;
  9. String endDate;
  10. String status;
  11. String description;
  12. int ageDayStartAt;
  13. int tbSuppliesId;
  14. String suppliesName;
  15. int tbGuidelineId;
  16. int netHouseId;
  17. String netHouseName;
  18. int areaId;
  19. String area;
  20. List<TbDetailUsers> tbDetailUsers;
  21. TbCropDTO(
  22. {this.id,
  23. this.qrCode,
  24. this.code,
  25. this.areaM2,
  26. this.tbCropTypeId,
  27. this.startDate,
  28. this.endDate,
  29. this.status,
  30. this.description,
  31. this.ageDayStartAt,
  32. this.tbSuppliesId,
  33. this.suppliesName,
  34. this.tbGuidelineId,
  35. this.netHouseId,
  36. this.netHouseName,
  37. this.areaId,
  38. this.area,
  39. this.tbDetailUsers});
  40. TbCropDTO.fromJson(Map<String, dynamic> json) {
  41. id = json['id'];
  42. qrCode = json['qrCode'];
  43. code = json['code'];
  44. areaM2 = json['areaM2'];
  45. tbCropTypeId = json['tbCropTypeId'];
  46. startDate = json['startDate'];
  47. endDate = json['endDate'];
  48. status = json['status'];
  49. description = json['description'];
  50. ageDayStartAt = json['ageDayStartAt'];
  51. tbSuppliesId = json['tbSuppliesId'];
  52. suppliesName = json['suppliesName'];
  53. tbGuidelineId = json['tbGuidelineId'];
  54. netHouseId = json['netHouseId'];
  55. netHouseName = json['netHouseName'];
  56. areaId = json['areaId'];
  57. area = json['area'];
  58. if (json['tbDetailUsers'] != null) {
  59. tbDetailUsers = new List<TbDetailUsers>();
  60. json['tbDetailUsers'].forEach((v) {
  61. tbDetailUsers.add(new TbDetailUsers.fromJson(v));
  62. });
  63. }
  64. }
  65. Map<String, dynamic> toJson() {
  66. final Map<String, dynamic> data = new Map<String, dynamic>();
  67. data['id'] = this.id;
  68. data['qrCode'] = this.qrCode;
  69. data['code'] = this.code;
  70. data['areaM2'] = this.areaM2;
  71. data['tbCropTypeId'] = this.tbCropTypeId;
  72. data['startDate'] = this.startDate;
  73. data['endDate'] = this.endDate;
  74. data['status'] = this.status;
  75. data['description'] = this.description;
  76. data['ageDayStartAt'] = this.ageDayStartAt;
  77. data['tbSuppliesId'] = this.tbSuppliesId;
  78. data['suppliesName'] = this.suppliesName;
  79. data['tbGuidelineId'] = this.tbGuidelineId;
  80. data['netHouseId'] = this.netHouseId;
  81. data['netHouseName'] = this.netHouseName;
  82. data['areaId'] = this.areaId;
  83. data['area'] = this.area;
  84. if (this.tbDetailUsers != null) {
  85. data['tbDetailUsers'] =
  86. this.tbDetailUsers.map((v) => v.toJson()).toList();
  87. }
  88. return data;
  89. }
  90. }