class User { final int id; final String phoneNumber; final String fullName; final String? username; final String? photo; const User({ required this.id, required this.username, required this.phoneNumber, required this.photo, required this.fullName, }); factory User.fromJson(Map json) => User( id: json['id'], username: json['username'], phoneNumber: json['phoneNumber'], photo: json['photo'], fullName: json['fullName']); Map toJson() => { 'id': id, 'username': username, 'phoneNumber': phoneNumber, 'photo': photo, 'fullName': fullName, }; User copyWith({ int? id, String? username, String? phoneNumber, String? photo, String? fullName, }) { return User( id: id ?? this.id, username: username ?? this.username, phoneNumber: phoneNumber ?? this.phoneNumber, photo: photo ?? this.photo, fullName: fullName ?? this.fullName, ); } }