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);
  int id;
  String nickname;
  String username;
  String icon;
  String phone;
  String sex;
  int moneyCoin; //余额
  double moneyPoint; //积分
  int birthday;
  bool noticeFlag;//是否通知
   bool remindFlag;//是否通知
  factory UserInfo.fromJson(Map<String, dynamic> json) =>
      _$UserInfoFromJson(json);

  Map<String, dynamic> toJson() => _$UserInfoToJson(this);

  // 命名构造函数
  UserInfo.empty();

  @override
  String toString() {
    return _$UserInfoToJson(this).toString();
  }
}
