game.dart 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import 'package:sport/bean/rank_game_info.dart';
  2. import 'package:sport/bean/sport_detail.dart';
  3. import 'package:sport/services/Converter.dart';
  4. class GameInfoData {
  5. int id;
  6. String name;
  7. List<String> tags;
  8. String cover;
  9. String coverHorizontal;
  10. String coverVertical;
  11. String introduceVideo;
  12. String introduceVideoCover;
  13. String introduce;
  14. List<String> introduceImages;
  15. double fileSize;
  16. String publishDate;
  17. String developCompany;
  18. int likeCount;
  19. int userCount;
  20. String version;
  21. String downloadUrl;
  22. int subjectId;
  23. String playTime;
  24. int durationTotal;
  25. GamesSum sum;
  26. bool isLike;
  27. int fileSizeByte;
  28. String packageNameIos,packageNameAndroid;
  29. Rank rank;
  30. bool isLocal;
  31. int difficulty;
  32. GameInfoData({
  33. this.id,
  34. this.name,
  35. this.tags,
  36. this.cover,
  37. this.coverHorizontal,
  38. this.coverVertical,
  39. this.introduceVideo,
  40. this.introduceVideoCover,
  41. this.introduce,
  42. this.introduceImages,
  43. this.fileSize,
  44. this.publishDate,
  45. this.developCompany,
  46. this.likeCount,
  47. this.userCount,
  48. this.version,
  49. this.downloadUrl,
  50. this.subjectId,
  51. this.isLike,
  52. this.fileSizeByte,
  53. this.packageNameIos,
  54. this.packageNameAndroid,
  55. this.isLocal,
  56. this.playTime,
  57. this.durationTotal,});
  58. GameInfoData.fromJson(Map<String, dynamic> json) {
  59. id = json['id'];
  60. name = json['name'];
  61. tags = json['tags'].cast<String>();
  62. cover = json['cover'];
  63. coverHorizontal = json['cover_horizontal'];
  64. coverVertical = json['cover_vertical'];
  65. introduceVideo = json['introduce_video'];
  66. introduceVideoCover = json['introduce_video_cover'];
  67. introduce = json['introduce'];
  68. introduceImages = json['introduce_images'].cast<String>();
  69. fileSize = Converter.toDouble(json['file_size']);
  70. publishDate = json['publish_date'];
  71. developCompany = json['develop_company'];
  72. likeCount = json['like_count'];
  73. userCount = json['user_count'];
  74. version = json['version'];
  75. downloadUrl = json['download_url'];
  76. subjectId = json['subject_id'];
  77. playTime = json['play_time'];
  78. durationTotal = json['duration_total'];
  79. sum = json['sum'] != null ? new GamesSum.fromJson(json['sum']) : null;
  80. isLike = json['is_like'];
  81. fileSizeByte = json['file_size_byte'];
  82. packageNameIos = json['package_name_ios'];
  83. packageNameAndroid = json['package_name_android'];
  84. rank = json['rank'] != null ? new Rank.fromJson(json['rank']) : null;
  85. isLocal = json['isLocal'];
  86. difficulty = json['difficulty'];
  87. }
  88. Map<String, dynamic> toJson() {
  89. final Map<String, dynamic> data = new Map<String, dynamic>();
  90. data['id'] = this.id;
  91. data['name'] = this.name;
  92. data['tags'] = this.tags;
  93. data['cover'] = this.cover;
  94. data['cover_horizontal'] = this.coverHorizontal;
  95. data['cover_vertical'] = this.coverVertical;
  96. data['cover_vertical'] = this.coverVertical;
  97. data['introduce_video'] = this.introduceVideo;
  98. data['introduce_video_cover'] = this.introduceVideoCover;
  99. data['introduce'] = this.introduce;
  100. data['introduce_images'] = this.introduceImages;
  101. data['file_size'] = this.fileSize;
  102. data['publish_date'] = this.publishDate;
  103. data['develop_company'] = this.developCompany;
  104. data['like_count'] = this.likeCount;
  105. data['user_count'] = this.userCount;
  106. data['version'] = this.version;
  107. data['download_url'] = this.downloadUrl;
  108. data['subject_id'] = this.subjectId;
  109. data['play_time'] = this.playTime;
  110. data['duration_total'] = this.durationTotal;
  111. data['is_like'] = this.isLike;
  112. data['file_size_byte'] = this.fileSizeByte;
  113. data['isLocal'] = this.isLocal;
  114. data['package_name_ios'] = this.packageNameIos;
  115. data['package_name_android'] = this.packageNameAndroid;
  116. if (this.rank != null) {
  117. data['rank'] = this.rank.toJson();
  118. }
  119. data['difficulty'] = this.difficulty;
  120. return data;
  121. }
  122. }