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.

75 lines
2.0KB

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