5/21/1
This commit is contained in:
@@ -123,7 +123,7 @@ class LoginCaptinController extends GetxController {
|
||||
'id': driverID,
|
||||
});
|
||||
print(res);
|
||||
if (res == 'failure') {
|
||||
if (res == 'Failure') {
|
||||
//Failure
|
||||
Get.offAll(SmsSignupEgypt());
|
||||
isloading = false;
|
||||
@@ -135,7 +135,10 @@ class LoginCaptinController extends GetxController {
|
||||
if (jsonDecoeded.isNotEmpty) {
|
||||
if (jsonDecoeded['status'] == 'success' &&
|
||||
jsonDecoeded['data'][0]['is_verified'] == 1) {
|
||||
//
|
||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||
box.write(BoxName.phoneVerified,
|
||||
jsonDecoeded['data'][0]['is_verified'].toString());
|
||||
box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
|
||||
Get.off(HomeCaptain());
|
||||
} else {
|
||||
Get.offAll(SmsSignupEgypt());
|
||||
|
||||
@@ -91,8 +91,8 @@ class RegisterCaptainController extends GetxController {
|
||||
'token_code': randomNumber.toString(),
|
||||
});
|
||||
|
||||
await smsEgyptController.sendSmsEgypt(
|
||||
phoneController.text.toString(), randomNumber.toString());
|
||||
// await smsEgyptController.sendSmsEgypt(
|
||||
// phoneController.text.toString(), randomNumber.toString());
|
||||
isSent = true;
|
||||
isLoading = false;
|
||||
update();
|
||||
@@ -102,19 +102,20 @@ class RegisterCaptainController extends GetxController {
|
||||
|
||||
verifySMSCode() async {
|
||||
if (formKey3.currentState!.validate()) {
|
||||
var res = await CRUD().post(link: AppLink.verifyOtpMessage, payload: {
|
||||
var res = await CRUD().post(link: AppLink.verifyOtpDriver, payload: {
|
||||
'phone_number': '+2${phoneController.text}',
|
||||
'token_code': verifyCode.text.toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
// var dec = jsonDecode(res);
|
||||
box.write(BoxName.phoneDriver, '+2${phoneController.text}');
|
||||
var res1 = await CRUD().post(
|
||||
link: AppLink.updateAccountBank,
|
||||
payload: {'phone': '+2${phoneController.text}'});
|
||||
if (jsonDecode(res1)['status'] == 'success') {
|
||||
Get.to(EgyptCardAI());
|
||||
}
|
||||
box.write(BoxName.phoneVerified, '1');
|
||||
// var res1 = await CRUD().post(
|
||||
// link: AppLink.updateAccountBank,
|
||||
// payload: {'phone': '+2${phoneController.text}'});
|
||||
// if (jsonDecode(res1)['status'] == 'success') {
|
||||
Get.to(EgyptCardAI());
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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