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.

59 lines
1.4KB

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