12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import 'package:sport/bean/game_record_sum.dart';
- import 'package:sport/services/Converter.dart';
- class GameRecordHistory {
- List<GameRecordSum>? records;
- JogInfo? jogInfo;
- GameRecordHistory({this.records, this.jogInfo});
- GameRecordHistory.fromJson(Map<String, dynamic> json) {
- if (json['records'] != null) {
- records = [];
- json['records'].forEach((v) {
- records!.add(GameRecordSum.fromJson(v));
- });
- }
- jogInfo = json['jog_info'] != null ? JogInfo.fromJson(json['jog_info']) : null;
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- if (this.records != null) {
- data['records'] = this.records!.map((v) => v.toJson()).toList();
- }
- if (this.jogInfo != null) {
- data['jog_info'] = this.jogInfo!.toJson();
- }
- return data;
- }
- }
- class JogInfo {
- int distanceJog = 0;
- int durationJog = 0;
- double stepRateJog = 0;
- int jogUserCount = 0;
- JogInfo({this.distanceJog = 0, this.durationJog = 0, this.stepRateJog = 0, this.jogUserCount = 0});
- JogInfo.fromJson(Map<String, dynamic> json) {
- distanceJog = json['distance_jog'];
- durationJog = json['duration_jog'];
- stepRateJog = Converter.toDouble(json['step_rate_jog']);
- jogUserCount = json['jog_user_count'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['distance_jog'] = this.distanceJog;
- data['duration_jog'] = this.durationJog;
- data['step_rate_jog'] = this.stepRateJog;
- data['jog_user_count'] = this.jogUserCount;
- return data;
- }
- }
|