import 'package:json_annotation/json_annotation.dart'; import 'GameInfo.dart'; part 'BindGameInfo.g.dart'; @JsonSerializable() class BindGameInfo { BindGameInfo(this.id, this.gameId, this.userId, this.nickName, this.gameInfo); factory BindGameInfo.fromJson(Map json) => _$BindGameInfoFromJson(json); BindGameInfo.empty(); int id; int gameId; //游戏ID int userId; //用户ID String nickName; //用户昵称 GameInfo gameInfo; //游戏信息 Map toJson() => _$BindGameInfoToJson(this); // 命名构造函数 @override String toString() { return _$BindGameInfoToJson(this).toString(); } }