This commit is contained in:
Hamza-Ayed
2024-08-27 10:49:43 +03:00
parent 2bc71355c3
commit d23020188e
48 changed files with 1872 additions and 432 deletions

View File

@@ -86,18 +86,26 @@ class GoogleSignInHelper {
static Future<GoogleSignInAccount?> signInFromLogin() async {
try {
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
if (googleUser != null) {
await _handleSignUp(googleUser);
await Get.find<LoginDriverController>().loginUsingCredentials(
box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver).toString(),
);
// Add detailed debug print statements
final driverID = box.read(BoxName.driverID)?.toString() ?? 'Unknown ID';
final emailDriver =
box.read(BoxName.emailDriver)?.toString() ?? 'Unknown Email';
// print('Driver ID: $driverID');
// print('Email Driver: $emailDriver');
await Get.find<LoginDriverController>()
.loginUsingCredentials(driverID, emailDriver);
}
return googleUser;
} catch (error) {
Get.snackbar('Google Sign-In error', '$error',
backgroundColor: AppColor.redColor);
// Log error details
print('Google Sign-In error: $error');
return null;
}