rank_info.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import 'package:sport/bean/game.dart';
  2. class RankInfoData {
  3. int id;
  4. String name;
  5. int isGame;
  6. int isSport;
  7. int gameId;
  8. String introduce;
  9. int userCountMax;
  10. String rateBegin;
  11. String rateEnd;
  12. GameInfoData game;
  13. RankInfoData(
  14. {this.id,
  15. this.name,
  16. this.isGame,
  17. this.isSport,
  18. this.gameId,
  19. this.introduce,
  20. this.userCountMax,
  21. this.rateBegin,
  22. this.rateEnd,
  23. this.game});
  24. RankInfoData.fromJson(Map<String, dynamic> json) {
  25. id = json['id'];
  26. name = json['name'];
  27. isGame = json['is_game'];
  28. isSport = json['is_sport'];
  29. gameId = json['game_id'];
  30. introduce = json['introduce'];
  31. userCountMax = json['user_count_max'];
  32. rateBegin = json['rate_begin'];
  33. rateEnd = json['rate_end'];
  34. game = json['game'] != null ? new GameInfoData.fromJson(json['game']) : null;
  35. }
  36. Map<String, dynamic> toJson() {
  37. final Map<String, dynamic> data = new Map<String, dynamic>();
  38. data['id'] = this.id;
  39. data['name'] = this.name;
  40. data['is_game'] = this.isGame;
  41. data['is_sport'] = this.isSport;
  42. data['game_id'] = this.gameId;
  43. data['introduce'] = this.introduce;
  44. data['user_count_max'] = this.userCountMax;
  45. data['rate_begin'] = this.rateBegin;
  46. data['rate_end'] = this.rateEnd;
  47. if (this.game != null) {
  48. data['game'] = this.game.toJson();
  49. }
  50. return data;
  51. }
  52. }
  53. class GameCover {
  54. String cover;
  55. String coverHorizontal;
  56. String coverVertical;
  57. GameCover({this.cover, this.coverHorizontal, this.coverVertical});
  58. GameCover.fromJson(Map<String, dynamic> json) {
  59. cover = json['cover'];
  60. coverHorizontal = json['cover_horizontal'];
  61. coverVertical = json['cover_vertical'];
  62. }
  63. Map<String, dynamic> toJson() {
  64. final Map<String, dynamic> data = new Map<String, dynamic>();
  65. data['cover'] = this.cover;
  66. data['cover_horizontal'] = this.coverHorizontal;
  67. data['cover_vertical'] = this.coverVertical;
  68. return data;
  69. }
  70. }