5/21/1
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
|
||||
import '../../onbording_page.dart';
|
||||
import '../../views/auth/captin/ai_page.dart';
|
||||
|
||||
class GoogleSignInHelper {
|
||||
@@ -66,6 +67,31 @@ class GoogleSignInHelper {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> _handleSignOut() async {
|
||||
// Clear stored driver information
|
||||
|
||||
box.remove(BoxName.driverID);
|
||||
box.remove(BoxName.emailDriver);
|
||||
box.remove(BoxName.lang);
|
||||
box.remove(BoxName.nameDriver);
|
||||
box.remove(BoxName.passengerID);
|
||||
box.remove(BoxName.phoneDriver);
|
||||
box.remove(BoxName.tokenFCM);
|
||||
box.remove(BoxName.tokens);
|
||||
box.remove(BoxName.carPlate);
|
||||
box.remove(BoxName.lastNameDriver);
|
||||
box.remove(BoxName.agreeTerms);
|
||||
box.remove(BoxName.tokenDriver);
|
||||
box.remove(BoxName.countryCode);
|
||||
box.remove(BoxName.accountIdStripeConnect);
|
||||
box.remove(BoxName.phoneVerified);
|
||||
Get.offAll(OnBoardingPage());
|
||||
// Perform any additional sign-out tasks or API calls here
|
||||
// For example, you can notify your server about the user sign-out
|
||||
|
||||
print('User data cleared.');
|
||||
}
|
||||
|
||||
// Method to get the current signed-in user
|
||||
static GoogleSignInAccount? getCurrentUser() {
|
||||
return _googleSignIn.currentUser;
|
||||
@@ -87,18 +113,4 @@ class GoogleSignInHelper {
|
||||
// print('nameDriver = ${box.read(BoxName.nameDriver)}');
|
||||
// print('driverPhotoUrl = ${box.read(BoxName.driverPhotoUrl)}');
|
||||
}
|
||||
|
||||
// Method to handle sign-out process
|
||||
static Future<void> _handleSignOut() async {
|
||||
// Clear stored driver information
|
||||
box.remove(BoxName.driverID);
|
||||
box.remove(BoxName.emailDriver);
|
||||
box.remove(BoxName.nameDriver);
|
||||
box.remove(BoxName.driverPhotoUrl);
|
||||
|
||||
// Perform any additional sign-out tasks or API calls here
|
||||
// For example, you can notify your server about the user sign-out
|
||||
|
||||
print('User data cleared.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user