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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 567 additions and 1147 deletions

View file

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