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