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.

79 lines
2.1KB

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