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.

82 lines
2.2KB

  1. import 'NurseryDetail.dart';
  2. class Nursery {
  3. int id;
  4. int activityId;
  5. int cropId;
  6. String executeDate;
  7. String description;
  8. String executeBy;
  9. String media;
  10. List<String> mediaDel;
  11. String seedName;
  12. num substratesId;
  13. String substrateName;
  14. num seedLength;
  15. num quantity;
  16. num seedIncubationTime;
  17. List<NurseryDetail> nurseryDetail;
  18. Nursery(
  19. {this.id,
  20. this.activityId,
  21. this.cropId,
  22. this.executeDate,
  23. this.description,
  24. this.executeBy,
  25. this.media,
  26. this.mediaDel,
  27. this.seedName,
  28. this.substratesId,
  29. this.substrateName,
  30. this.seedLength,
  31. this.quantity,
  32. this.seedIncubationTime,
  33. this.nurseryDetail});
  34. Nursery.fromJson(Map<String, dynamic> json) {
  35. id = json['id'];
  36. activityId = json['activityId'];
  37. cropId = json['cropId'];
  38. executeDate = json['executeDate'];
  39. description = json['description'];
  40. executeBy = json['executeBy'];
  41. media = json['media'];
  42. seedName = json['seedName'];
  43. substratesId = json['substratesId'];
  44. substrateName = json['substrateName'];
  45. seedLength = json['seedLength'];
  46. quantity = json['quantity'];
  47. seedIncubationTime = json['seedIncubationTime'];
  48. if (json['nurseryDetail'] != null) {
  49. nurseryDetail = new List<NurseryDetail>();
  50. json['nurseryDetail'].forEach((v) {
  51. nurseryDetail.add(new NurseryDetail.fromJson(v));
  52. });
  53. }
  54. }
  55. Map<String, dynamic> toJson() {
  56. final Map<String, dynamic> data = new Map<String, dynamic>();
  57. data['id'] = this.id;
  58. data['activityId'] = this.activityId;
  59. data['cropId'] = this.cropId;
  60. data['executeDate'] = this.executeDate;
  61. data['description'] = this.description;
  62. data['executeBy'] = this.executeBy;
  63. data['media'] = this.media;
  64. data['media_del'] = this.mediaDel;
  65. data['seedName'] = this.seedName;
  66. data['substratesId'] = this.substratesId;
  67. data['substrateName'] = this.substrateName;
  68. data['seedLength'] = this.seedLength;
  69. data['quantity'] = this.quantity;
  70. data['seedIncubationTime'] = this.seedIncubationTime;
  71. if (this.nurseryDetail != null) {
  72. data['nurseryDetail'] =
  73. this.nurseryDetail.map((v) => v.toJson()).toList();
  74. }
  75. return data;
  76. }
  77. }