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.

73 lines
2.0KB

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