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.

55 lines
1.5KB

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