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
1.9KB

  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(SuppliesUsing.fromJson(v));
  46. });
  47. }
  48. }
  49. Map<String, dynamic> toJson() {
  50. final data = <String, dynamic>{};
  51. data['id'] = id;
  52. data['activityId'] = activityId;
  53. data['cropId'] = cropId;
  54. data['media'] = media;
  55. data['media_del'] = mediaDel;
  56. data['executeDate'] = executeDate;
  57. data['quarantinePeriod'] = quarantinePeriod;
  58. data['resultAt'] = resultAt;
  59. data['weatherConditions'] = weatherConditions;
  60. data['purpose'] = purpose;
  61. data['description'] = description;
  62. data['executeBy'] = executeBy;
  63. if (suppliesUsing != null) {
  64. data['suppliesUsing'] = suppliesUsing?.map((v) => v.toJson()).toList();
  65. }
  66. return data;
  67. }
  68. }