import 'package:sport/bean/user.dart'; class RankGameInfoData { Rank rank; User user; List records; RankGameInfoData({this.rank, this.user, this.records}); RankGameInfoData.fromJson(Map json) { rank = json['rank'] != null ? new Rank.fromJson(json['rank']) : null; user = json['user'] != null ? new User.fromJson(json['user']) : null; if (json['records'] != null) { records = new List(); json['records'].forEach((v) { records.add(new User.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); if (this.rank != null) { data['rank'] = this.rank.toJson(); } if (this.user != null) { data['user'] = this.user.toJson(); } if (this.records != null) { data['records'] = this.records.map((v) => v.toJson()).toList(); } return data; } } class Rank { int id; String name; int isGame; int isSport; int gameId; String introduce; String introduceDetail; String rule; String distribute; int userCountMax; String rateBegin; String rateEnd; String logo; String field; String slogan; List reward; Rank( {this.id, this.name, this.isGame, this.isSport, this.gameId, this.introduce, this.userCountMax, this.rateBegin, this.rateEnd, this.logo, this.field, this.slogan, this.reward, }); Rank.fromJson(Map json) { id = json['id']; name = json['name']; isGame = json['is_game']; isSport = json['is_sport']; gameId = json['game_id']; introduce = json['introduce']; introduceDetail = json['introduce_detail']; rule = json['rule']; distribute = json['distribute']; userCountMax = json['user_count_max']; rateBegin = json['rate_begin']; rateEnd = json['rate_end']; logo = json['logo']; field = json['field']; slogan = json['slogan']; if (json['reward'] != null) { reward = new List(); json['reward'].forEach((v) { reward.add(new RankReward.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['name'] = this.name; data['is_game'] = this.isGame; data['is_sport'] = this.isSport; data['game_id'] = this.gameId; data['introduce'] = this.introduce; data['introduce_detail'] = this.introduceDetail; data['distribute'] = this.distribute; data['rule'] = this.rule; data['user_count_max'] = this.userCountMax; data['rate_begin'] = this.rateBegin; data['rate_end'] = this.rateEnd; data['logo'] = this.logo; data['field'] = this.field; data['slogan'] = this.slogan; data['reward'] = this.reward; return data; } } class RankReward{ int begin; int end; int score; RankReward({ this.begin, this.end, this.score }); Map toJson() { final Map data = new Map(); data['begin'] = this.begin; data['end'] = this.end; data['score'] = this.score; return data; } RankReward.fromJson(Map json) { begin = json['begin']; end = json['end']; score = json['score']; } }