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.

71 lines
1.9KB

  1. import 'SuppliesUsing.dart';
  2. class Spraying {
  3. int id;
  4. int activityId;
  5. int cropId;
  6. String media;
  7. String executeDate;
  8. num quarantinePeriod;
  9. String resultAt;
  10. String weatherConditions;
  11. String purpose;
  12. String description;
  13. String executeBy;
  14. List<SuppliesUsing> suppliesUsing;
  15. Spraying(
  16. {this.id,
  17. this.activityId,
  18. this.cropId,
  19. this.media,
  20. this.executeDate,
  21. this.quarantinePeriod,
  22. this.resultAt,
  23. this.weatherConditions,
  24. this.purpose,
  25. this.description,
  26. this.executeBy,
  27. this.suppliesUsing});
  28. Spraying.fromJson(Map<String, dynamic> json) {
  29. id = json['id'];
  30. activityId = json['activityId'];
  31. cropId = json['cropId'];
  32. media = json['media'];
  33. executeDate = json['executeDate'];
  34. quarantinePeriod = json['quarantinePeriod'];
  35. resultAt = json['resultAt'];
  36. weatherConditions = json['weatherConditions'];
  37. purpose = json['purpose'];
  38. description = json['description'];
  39. executeBy = json['executeBy'];
  40. if (json['suppliesUsing'] != null) {
  41. suppliesUsing = new List<SuppliesUsing>();
  42. json['suppliesUsing'].forEach((v) {
  43. suppliesUsing.add(new SuppliesUsing.fromJson(v));
  44. });
  45. }
  46. }
  47. Map<String, dynamic> toJson() {
  48. final Map<String, dynamic> data = new Map<String, dynamic>();
  49. data['id'] = this.id;
  50. data['activityId'] = this.activityId;
  51. data['cropId'] = this.cropId;
  52. data['media'] = this.media;
  53. data['executeDate'] = this.executeDate;
  54. data['quarantinePeriod'] = this.quarantinePeriod;
  55. data['resultAt'] = this.resultAt;
  56. data['weatherConditions'] = this.weatherConditions;
  57. data['purpose'] = this.purpose;
  58. data['description'] = this.description;
  59. data['executeBy'] = this.executeBy;
  60. if (this.suppliesUsing != null) {
  61. data['suppliesUsing'] =
  62. this.suppliesUsing.map((v) => v.toJson()).toList();
  63. }
  64. return data;
  65. }
  66. }