class UserInfoModel {
  UserInfoModel({
    required this.userId,
    required this.username,
    required this.nickname,
    required this.avatar,
    required this.address,
  });

  String userId;
  String username;
  String? nickname;
  String? avatar;
  String? address;

  factory UserInfoModel.fromJson(Map<String, dynamic> json) => UserInfoModel(
        userId: json['user_id'].toString(),
        username: json['username'],
        nickname: json['nickname'],
        avatar: json['avatar'],
        address: json['address'],
      );

  factory UserInfoModel.empty() => UserInfoModel(
        userId: '',
        username: '',
        nickname: '',
        avatar: '',
        address: '',
      );

  Map<String, dynamic> toJson() => {
        "userId": userId,
        "username": username,
        "nickname": nickname,
        "avatar": avatar,
        "address": address,
      };
}
