Enhance Google and Apple sign-up methods to include name and firstname parameters

This commit is contained in:
Van Leemput Dayron
2025-11-06 11:28:18 +01:00
parent fa7daca50a
commit 75bdf591f3
6 changed files with 205 additions and 75 deletions

View File

@@ -171,7 +171,11 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
// This method can be implemented if needed for Google sign-up specific logic.
emit(AuthLoading());
try {
final user = await _authRepository.signUpWithGoogle(event.phoneNumber);
final user = await _authRepository.signUpWithGoogle(
event.phoneNumber,
event.name,
event.firstname,
);
if (user != null) {
emit(AuthAuthenticated(user: user));
@@ -190,7 +194,11 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
// This method can be implemented if needed for Apple sign-up specific logic.
emit(AuthLoading());
try {
final user = await _authRepository.signUpWithApple(event.phoneNumber);
final user = await _authRepository.signUpWithApple(
event.phoneNumber,
event.name,
event.firstname,
);
if (user != null) {
emit(AuthAuthenticated(user: user));

View File

@@ -81,11 +81,17 @@ class AuthGoogleSignInRequested extends AuthEvent {}
class AuthGoogleSignUpRequested extends AuthEvent {
/// The user's phone number.
final String phoneNumber;
final String name;
final String firstname;
/// Creates a new [AuthGoogleSignUpRequested] event.
///
/// The [phoneNumber] parameter is required.
const AuthGoogleSignUpRequested({required this.phoneNumber});
const AuthGoogleSignUpRequested({
required this.phoneNumber,
required this.name,
required this.firstname,
});
@override
List<Object?> get props => [phoneNumber];
@@ -99,11 +105,17 @@ class AuthAppleSignInRequested extends AuthEvent {}
class AuthAppleSignUpRequested extends AuthEvent {
/// The user's phone number.
final String phoneNumber;
final String name;
final String firstname;
/// Creates a new [AuthAppleSignUpRequested] event.
///
/// The [phoneNumber] parameter is required.
const AuthAppleSignUpRequested({required this.phoneNumber});
const AuthAppleSignUpRequested({
required this.phoneNumber,
required this.name,
required this.firstname,
});
@override
List<Object?> get props => [phoneNumber];