import 'package:json_annotation/json_annotation.dart'; part 'GameInfo.g.dart'; @JsonSerializable() class GameInfo { GameInfo(this.id, this.gameName, this.icon, this.typeFlag,this.shortName,this.profile); int id; String gameName;//名称 String icon;//图标 int typeFlag;//类型 String shortName;//简称 String profile;//简介 factory GameInfo.fromJson(Map json) => _$GameInfoFromJson(json); Map toJson() => _$GameInfoToJson(this); // 命名构造函数 GameInfo.empty(); @override String toString() { return _$GameInfoToJson(this).toString(); } }