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.

67 lines
1.8KB

  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<SuppliesUsing> suppliesUsing;
  14. Dung(
  15. {this.id,
  16. this.activityId,
  17. this.cropId,
  18. this.executeDate,
  19. this.description,
  20. this.media,
  21. this.quarantinePeriod,
  22. this.weatherConditions,
  23. this.purpose,
  24. this.executeBy,
  25. this.suppliesUsing});
  26. Dung.fromJson(Map<String, dynamic> json) {
  27. id = json['id'];
  28. cropId = json['cropId'];
  29. activityId = json['activityId'];
  30. executeDate = json['executeDate'];
  31. description = json['description'];
  32. media = json['media'];
  33. quarantinePeriod = json['quarantinePeriod'];
  34. weatherConditions = json['weatherConditions'];
  35. purpose = json['purpose'];
  36. executeBy = json['executeBy'];
  37. if (json['suppliesUsing'] != null) {
  38. suppliesUsing = new List<SuppliesUsing>();
  39. json['suppliesUsing'].forEach((v) {
  40. suppliesUsing.add(new SuppliesUsing.fromJson(v));
  41. });
  42. }
  43. }
  44. Map<String, dynamic> toJson() {
  45. final Map<String, dynamic> data = new Map<String, dynamic>();
  46. data['id'] = this.id;
  47. data['cropId'] = this.cropId;
  48. data['activityId'] = this.activityId;
  49. data['executeDate'] = this.executeDate;
  50. data['description'] = this.description;
  51. data['media'] = this.media;
  52. data['quarantinePeriod'] = this.quarantinePeriod;
  53. data['weatherConditions'] = this.weatherConditions;
  54. data['purpose'] = this.purpose;
  55. data['executeBy'] = this.executeBy;
  56. if (this.suppliesUsing != null) {
  57. data['suppliesUsing'] =
  58. this.suppliesUsing.map((v) => v.toJson()).toList();
  59. }
  60. return data;
  61. }
  62. }