GameInfo.dart 544 B

12345678910111213141516171819202122
  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);
  6. int id;
  7. String gameName;//名称
  8. String icon;//图标
  9. int typeFlag;//类型
  10. factory GameInfo.fromJson(Map<String, dynamic> json) =>
  11. _$GameInfoFromJson(json);
  12. Map<String, dynamic> toJson() => _$GameInfoToJson(this);
  13. // 命名构造函数
  14. GameInfo.empty();
  15. @override
  16. String toString() {
  17. return _$GameInfoToJson(this).toString();
  18. }
  19. }