class JogSum { Sum? sum; List? records; JogSum({this.sum, this.records}); JogSum.fromJson(Map json) { sum = json['sum'] != null ? new Sum.fromJson(json['sum']) : null; if (json['records'] != null) { records = []; json['records'].forEach((v) { records!.add(new Records.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); if (this.sum != null) { data['sum'] = this.sum!.toJson(); } if (this.records != null) { data['records'] = this.records!.map((v) => v.toJson()).toList(); } return data; } } class Sum { int? distance; int? duration; int? times; int? kmDuration; Sum({this.distance, this.duration, this.times, this.kmDuration}); Sum.fromJson(Map json) { distance = json['distance']; duration = json['duration']; times = json['times']; kmDuration = json['km_duration']; } Map toJson() { final Map data = new Map(); data['distance'] = this.distance; data['duration'] = this.duration; data['times'] = this.times; data['km_duration'] = this.kmDuration; return data; } } class Records { int? month; int? distance; int? duration; int? kmDuration; List? records; bool expand = true; Records( {this.month, this.distance, this.duration, this.kmDuration, this.records}); Records.fromJson(Map json) { month = json['month']; distance = json['distance']; duration = json['duration']; kmDuration = json['km_duration']; if (json['records'] != null) { records = []; json['records'].forEach((v) { records!.add(new SumRecords.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['month'] = this.month; data['distance'] = this.distance; data['duration'] = this.duration; data['km_duration'] = this.kmDuration; if (this.records != null) { data['records'] = this.records!.map((v) => v.toJson()).toList(); } return data; } } class SumRecords { int? id; int? distance; int? duration; String? begin; String? end; int? kmDuration; SumRecords( {this.id, this.distance, this.duration, this.begin, this.end, this.kmDuration}); SumRecords.fromJson(Map json) { id = json['id']; distance = json['distance']; duration = json['duration']; begin = json['begin']; end = json['end']; kmDuration = json['km_duration']; } Map toJson() { final Map data = new Map(); data['distance'] = this.distance; data['duration'] = this.duration; data['begin'] = this.begin; data['end'] = this.end; data['km_duration'] = this.kmDuration; return data; } }