class MineProfileModel {
  String username;
  String avatar;
  String inviteCode;
  String userLvName;
  String userLvIcon;
  String total;
  List<MineProfileDataModel> gridViews;

  MineProfileModel(
      {this.username,
        this.avatar,
        this.inviteCode,
        this.userLvName,
        this.userLvIcon,
        this.total,
        this.gridViews});

  MineProfileModel.fromJson(Map<String, dynamic> json) {
    username = json['username'];
    avatar = json['avatar'];
    inviteCode = json['InviteCode'];
    userLvName = json['user_lv_name'];
    userLvIcon = json['user_lv_icon'];
    total = json['total'];
    if (json['grid_views'] != null) {
      gridViews = new List<MineProfileDataModel>();
      json['grid_views'].forEach((v) {
        gridViews.add(new MineProfileDataModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['username'] = this.username;
    data['avatar'] = this.avatar;
    data['InviteCode'] = this.inviteCode;
    data['user_lv_name'] = this.userLvName;
    data['user_lv_icon'] = this.userLvIcon;
    data['total'] = this.total;
    if (this.gridViews != null) {
      data['grid_views'] = this.gridViews.map((v) => v.toJson()).toList();
    }
    return data;
  }
}


class MineProfileDataModel {
  String name;
  String value;

  MineProfileDataModel({this.name, this.value});

  MineProfileDataModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    value = json['value'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['value'] = this.value;
    return data;
  }
}

