sum.dart 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. class JogSum {
  2. Sum? sum;
  3. List<Records>? records;
  4. JogSum({this.sum, this.records});
  5. JogSum.fromJson(Map<String, dynamic> json) {
  6. sum = json['sum'] != null ? new Sum.fromJson(json['sum']) : null;
  7. if (json['records'] != null) {
  8. records = [];
  9. json['records'].forEach((v) {
  10. records!.add(new Records.fromJson(v));
  11. });
  12. }
  13. }
  14. Map<String, dynamic> toJson() {
  15. final Map<String, dynamic> data = new Map<String, dynamic>();
  16. if (this.sum != null) {
  17. data['sum'] = this.sum!.toJson();
  18. }
  19. if (this.records != null) {
  20. data['records'] = this.records!.map((v) => v.toJson()).toList();
  21. }
  22. return data;
  23. }
  24. }
  25. class Sum {
  26. int? distance;
  27. int? duration;
  28. int? times;
  29. int? kmDuration;
  30. Sum({this.distance, this.duration, this.times, this.kmDuration});
  31. Sum.fromJson(Map<String, dynamic> json) {
  32. distance = json['distance'];
  33. duration = json['duration'];
  34. times = json['times'];
  35. kmDuration = json['km_duration'];
  36. }
  37. Map<String, dynamic> toJson() {
  38. final Map<String, dynamic> data = new Map<String, dynamic>();
  39. data['distance'] = this.distance;
  40. data['duration'] = this.duration;
  41. data['times'] = this.times;
  42. data['km_duration'] = this.kmDuration;
  43. return data;
  44. }
  45. }
  46. class Records {
  47. int? month;
  48. int? distance;
  49. int? duration;
  50. int? kmDuration;
  51. List<SumRecords>? records;
  52. bool expand = true;
  53. Records(
  54. {this.month,
  55. this.distance,
  56. this.duration,
  57. this.kmDuration,
  58. this.records});
  59. Records.fromJson(Map<String, dynamic> json) {
  60. month = json['month'];
  61. distance = json['distance'];
  62. duration = json['duration'];
  63. kmDuration = json['km_duration'];
  64. if (json['records'] != null) {
  65. records = [];
  66. json['records'].forEach((v) {
  67. records!.add(new SumRecords.fromJson(v));
  68. });
  69. }
  70. }
  71. Map<String, dynamic> toJson() {
  72. final Map<String, dynamic> data = new Map<String, dynamic>();
  73. data['month'] = this.month;
  74. data['distance'] = this.distance;
  75. data['duration'] = this.duration;
  76. data['km_duration'] = this.kmDuration;
  77. if (this.records != null) {
  78. data['records'] = this.records!.map((v) => v.toJson()).toList();
  79. }
  80. return data;
  81. }
  82. }
  83. class SumRecords {
  84. int? id;
  85. int? distance;
  86. int? duration;
  87. String? begin;
  88. String? end;
  89. int? kmDuration;
  90. SumRecords(
  91. {this.id, this.distance, this.duration, this.begin, this.end, this.kmDuration});
  92. SumRecords.fromJson(Map<String, dynamic> json) {
  93. id = json['id'];
  94. distance = json['distance'];
  95. duration = json['duration'];
  96. begin = json['begin'];
  97. end = json['end'];
  98. kmDuration = json['km_duration'];
  99. }
  100. Map<String, dynamic> toJson() {
  101. final Map<String, dynamic> data = new Map<String, dynamic>();
  102. data['distance'] = this.distance;
  103. data['duration'] = this.duration;
  104. data['begin'] = this.begin;
  105. data['end'] = this.end;
  106. data['km_duration'] = this.kmDuration;
  107. return data;
  108. }
  109. }