import 'package:json_annotation/json_annotation.dart'; part 'UserInfo.g.dart'; @JsonSerializable() class UserInfo { UserInfo(this.id, this.nickname, this.username, this.icon, this.phone, this.sex, this.moneyCoin, this.moneyPoint, this.birthday, this.noticeFlag, this.remindFlag, this.createFlag, this.ttdjId, this.isVip, this.startDate, this.expierDate); int id; String nickname; String username; String icon; String phone; String sex; double moneyCoin; //余额 double moneyPoint; //积分 int birthday; String noticeFlag; //是否通知 String remindFlag; //是否通知 String createFlag; //创建房间权限 String ttdjId; String token; bool isVip; String startDate; String expierDate; factory UserInfo.fromJson(Map json) => _$UserInfoFromJson(json); Map toJson() => _$UserInfoToJson(this); // 命名构造函数 UserInfo.empty(); @override String toString() { return _$UserInfoToJson(this).toString(); } }