class AuthResponse { final String token; final String? username; final String? nickname; const AuthResponse({required this.token, this.username, this.nickname}); factory AuthResponse.fromJson(Map json) => AuthResponse( token: json['token']?.toString() ?? '', username: json['username']?.toString(), nickname: json['nickname']?.toString(), ); } class UserInfo { final String? id; final String username; final String nickname; const UserInfo({this.id, required this.username, required this.nickname}); Map toJson() => {'id': id, 'username': username, 'nickname': nickname}; factory UserInfo.fromJson(Map json) => UserInfo( id: json['id']?.toString(), username: json['username']?.toString() ?? '', nickname: json['nickname']?.toString() ?? '', ); }