class KRUserInfo { final int id; final String email; final int refererId; final String referCode; final String avatar; final String areaCode; final String telephone; final int balance; final int commission; final int referralPercentage; final bool onlyFirstPurchase; final int giftAmount; KRUserInfo({ required this.id, required this.email, this.refererId = 0, this.referCode = '', this.avatar = '', this.areaCode = '', this.telephone = '', this.balance = 0, this.commission = 0, this.referralPercentage = 0, this.onlyFirstPurchase = false, this.giftAmount = 0, }); factory KRUserInfo.fromJson(Map json) { return KRUserInfo( id: json['id'] ?? 0, email: json['email'] ?? '', refererId: json['referer_id'] ?? 0, referCode: json['refer_code'] ?? '', avatar: json['avatar'] ?? '', areaCode: json['area_code'] ?? '', telephone: json['telephone'] ?? '', balance: json['balance'] ?? 0, commission: json['commission'] ?? 0, referralPercentage: json['referral_percentage'] ?? 0, onlyFirstPurchase: json['only_first_purchase'] ?? false, giftAmount: json['gift_amount'] ?? 0, ); } }