class UserInfo {
  int? id;
  String? name;
  dynamic avatar;
  String? email;
  dynamic emailVerifiedAt;
  dynamic googleId;
  dynamic appleId;
  String? lastLoginIp;
  String? lastLoginTime;
  dynamic lastUsedTime;
  int? status;
  String? createdAt;
  String? updatedAt;

  UserInfo({
    this.id,
    this.name,
    this.avatar,
    this.email,
    this.emailVerifiedAt,
    this.googleId,
    this.appleId,
    this.lastLoginIp,
    this.lastLoginTime,
    this.lastUsedTime,
    this.status,
    this.createdAt,
    this.updatedAt,
  });

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map["id"] = id;
    map["name"] = name;
    map["avatar"] = avatar;
    map["email"] = email;
    map["email_verified_at"] = emailVerifiedAt;
    map["google_id"] = googleId;
    map["apple_id"] = appleId;
    map["last_login_ip"] = lastLoginIp;
    map["last_login_time"] = lastLoginTime;
    map["last_used_time"] = lastUsedTime;
    map["status"] = status;
    map["created_at"] = createdAt;
    map["updated_at"] = updatedAt;
    return map;
  }

  UserInfo.fromJson(dynamic json) {
    id = json["id"] ?? 0;
    name = json["name"] ?? "";
    avatar = json["avatar"];
    email = json["email"] ?? "";
    emailVerifiedAt = json["email_verified_at"];
    googleId = json["google_id"];
    appleId = json["apple_id"];
    lastLoginIp = json["last_login_ip"] ?? "";
    lastLoginTime = json["last_login_time"] ?? "";
    lastUsedTime = json["last_used_time"];
    status = json["status"] ?? 0;
    createdAt = json["created_at"] ?? "";
    updatedAt = json["updated_at"] ?? "";
  }
}

class LoginDto {
  String? accessToken;
  UserInfo? userInfo;

  LoginDto({this.accessToken, this.userInfo});

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map["accessToken"] = accessToken;
    if (userInfo != null) {
      map["userInfo"] = userInfo?.toJson();
    }
    return map;
  }

  LoginDto.fromJson(dynamic json) {
    accessToken = json["accessToken"] ?? "";
    userInfo = json["userInfo"] != null ? UserInfo.fromJson(json["userInfo"]) : null;
  }
}
