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.

70 lines
1.9KB

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