import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/user_profile.dart'; UserProfile $UserProfileFromJson(Map json) { final UserProfile userProfile = UserProfile(); final int? id = jsonConvert.convert(json['id']); if (id != null) { userProfile.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { userProfile.name = name; } final String? phone = jsonConvert.convert(json['phone']); if (phone != null) { userProfile.phone = phone; } final String? avatar = jsonConvert.convert(json['avatar']); if (avatar != null) { userProfile.avatar = avatar; } final String? passwordType = jsonConvert.convert(json['password_type']); if (passwordType != null) { userProfile.passwordType = passwordType; } final dynamic registrationId = json['registration_id']; if (registrationId != null) { userProfile.registrationId = registrationId; } return userProfile; } Map $UserProfileToJson(UserProfile entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['phone'] = entity.phone; data['avatar'] = entity.avatar; data['password_type'] = entity.passwordType; data['registration_id'] = entity.registrationId; return data; } extension UserProfileExtension on UserProfile { UserProfile copyWith({ int? id, String? name, String? phone, String? avatar, String? passwordType, dynamic registrationId, }) { return UserProfile() ..id = id ?? this.id ..name = name ?? this.name ..phone = phone ?? this.phone ..avatar = avatar ?? this.avatar ..passwordType = passwordType ?? this.passwordType ..registrationId = registrationId ?? this.registrationId; } }