GameInfo.dart 626 B

123456789101112131415161718192021222324
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'GameInfo.g.dart';
  3. @JsonSerializable()
  4. class GameInfo {
  5. GameInfo(this.id, this.gameName, this.icon, this.typeFlag,this.shortName,this.profile);
  6. int id;
  7. String gameName;//名称
  8. String icon;//图标
  9. int typeFlag;//类型
  10. String shortName;//简称
  11. String profile;//简介
  12. factory GameInfo.fromJson(Map<String, dynamic> json) =>
  13. _$GameInfoFromJson(json);
  14. Map<String, dynamic> toJson() => _$GameInfoToJson(this);
  15. // 命名构造函数
  16. GameInfo.empty();
  17. @override
  18. String toString() {
  19. return _$GameInfoToJson(this).toString();
  20. }
  21. }