import 'dart:convert'; class UserDetailResponse { UserDetailResponse({ required this.data, }); UserDetail data; factory UserDetailResponse.fromJson(Map json) => UserDetailResponse( data: UserDetail.fromJson(json["data"]), ); } class UserDetail { User user; String profilePicture; UserDetail({ required this.user, required this.profilePicture, }); factory UserDetail.fromJson(Map json) => UserDetail( user: User.fromJson(json["user"]), profilePicture: json["profile_picture"], ); Map toJson() => { "user": user.toJson(), "profile_picture": profilePicture, }; } class User { String firstName; String lastName; String username; String email; User({ required this.firstName, required this.lastName, required this.username, required this.email, }); factory User.fromJson(Map json) => User( firstName: json["first_name"], lastName: json["last_name"], username: json["username"], email: json["email"], ); Map toJson() => { "first_name": firstName, "last_name": lastName, "username": username, "email": email, }; }