import 'package:json_annotation/json_annotation.dart'; part 'character_group_info.g.dart'; @JsonSerializable() class CharacterGroupInfo { //主题id @JsonKey(name: 'id') late String id; //主题名称 @JsonKey(name: 'name') late String name; //icon @JsonKey(name: 'iconUrl') late String iconUrl; CharacterGroupInfo({ required this.id, required this.name, required this.iconUrl, }); factory CharacterGroupInfo.fromJson(Map json) => _$CharacterGroupInfoFromJson(json); Map toJson() => _$CharacterGroupInfoToJson(this); }