fix: replace first and last name with single field (#4915)

This commit is contained in:
Brian Austin
2023-11-11 20:03:32 -05:00
committed by GitHub
parent 413ab2c538
commit 7fca0d8da5
98 changed files with 567 additions and 1147 deletions

View File

@@ -14,48 +14,42 @@ class UserDto {
/// Returns a new [UserDto] instance.
UserDto({
required this.email,
required this.firstName,
required this.id,
required this.lastName,
required this.name,
required this.profileImagePath,
});
String email;
String firstName;
String id;
String lastName;
String name;
String profileImagePath;
@override
bool operator ==(Object other) => identical(this, other) || other is UserDto &&
other.email == email &&
other.firstName == firstName &&
other.id == id &&
other.lastName == lastName &&
other.name == name &&
other.profileImagePath == profileImagePath;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(email.hashCode) +
(firstName.hashCode) +
(id.hashCode) +
(lastName.hashCode) +
(name.hashCode) +
(profileImagePath.hashCode);
@override
String toString() => 'UserDto[email=$email, firstName=$firstName, id=$id, lastName=$lastName, profileImagePath=$profileImagePath]';
String toString() => 'UserDto[email=$email, id=$id, name=$name, profileImagePath=$profileImagePath]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'email'] = this.email;
json[r'firstName'] = this.firstName;
json[r'id'] = this.id;
json[r'lastName'] = this.lastName;
json[r'name'] = this.name;
json[r'profileImagePath'] = this.profileImagePath;
return json;
}
@@ -69,9 +63,8 @@ class UserDto {
return UserDto(
email: mapValueOfType<String>(json, r'email')!,
firstName: mapValueOfType<String>(json, r'firstName')!,
id: mapValueOfType<String>(json, r'id')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
name: mapValueOfType<String>(json, r'name')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
);
}
@@ -121,9 +114,8 @@ class UserDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'email',
'firstName',
'id',
'lastName',
'name',
'profileImagePath',
};
}