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

@@ -3,8 +3,7 @@ class AuthenticationState {
final String userId;
final String userEmail;
final bool isAuthenticated;
final String firstName;
final String lastName;
final String name;
final bool isAdmin;
final bool shouldChangePassword;
final String profileImagePath;
@@ -13,8 +12,7 @@ class AuthenticationState {
required this.userId,
required this.userEmail,
required this.isAuthenticated,
required this.firstName,
required this.lastName,
required this.name,
required this.isAdmin,
required this.shouldChangePassword,
required this.profileImagePath,
@@ -25,8 +23,7 @@ class AuthenticationState {
String? userId,
String? userEmail,
bool? isAuthenticated,
String? firstName,
String? lastName,
String? name,
bool? isAdmin,
bool? shouldChangePassword,
String? profileImagePath,
@@ -36,8 +33,7 @@ class AuthenticationState {
userId: userId ?? this.userId,
userEmail: userEmail ?? this.userEmail,
isAuthenticated: isAuthenticated ?? this.isAuthenticated,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
name: name ?? this.name,
isAdmin: isAdmin ?? this.isAdmin,
shouldChangePassword: shouldChangePassword ?? this.shouldChangePassword,
profileImagePath: profileImagePath ?? this.profileImagePath,
@@ -46,7 +42,7 @@ class AuthenticationState {
@override
String toString() {
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, firstName: $firstName, lastName: $lastName, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, name: $name, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
}
@override
@@ -58,8 +54,7 @@ class AuthenticationState {
other.userId == userId &&
other.userEmail == userEmail &&
other.isAuthenticated == isAuthenticated &&
other.firstName == firstName &&
other.lastName == lastName &&
other.name == name &&
other.isAdmin == isAdmin &&
other.shouldChangePassword == shouldChangePassword &&
other.profileImagePath == profileImagePath;
@@ -71,8 +66,7 @@ class AuthenticationState {
userId.hashCode ^
userEmail.hashCode ^
isAuthenticated.hashCode ^
firstName.hashCode ^
lastName.hashCode ^
name.hashCode ^
isAdmin.hashCode ^
shouldChangePassword.hashCode ^
profileImagePath.hashCode;

View File

@@ -26,8 +26,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -117,8 +116,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -208,8 +206,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
isAuthenticated: true,
userId: user.id,
userEmail: user.email,
firstName: user.firstName,
lastName: user.lastName,
name: user.name,
profileImagePath: user.profileImagePath,
isAdmin: user.isAdmin,
shouldChangePassword: shouldChangePassword,

View File

@@ -46,8 +46,7 @@ class ChangePasswordForm extends HookConsumerWidget {
child: Text(
'change_password_form_description'.tr(
namedArgs: {
'firstName': authState.firstName,
'lastName': authState.lastName,
'name': authState.name,
},
),
style: TextStyle(