6/28/1
This commit is contained in:
@@ -18,7 +18,7 @@ import 'package:location/location.dart';
|
||||
|
||||
import '../../firebase/firbase_messge.dart';
|
||||
|
||||
class LoginCaptinController extends GetxController {
|
||||
class LoginDriverController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
TextEditingController emailController = TextEditingController();
|
||||
TextEditingController phoneController = TextEditingController();
|
||||
@@ -110,7 +110,7 @@ class LoginCaptinController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
loginFromSignInGoogle(String driverID, email) async {
|
||||
loginUsingCredentials(String driverID, email) async {
|
||||
isloading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
|
||||
|
||||
@@ -124,13 +124,13 @@ class RegisterCaptainController extends GetxController {
|
||||
sendVerifications() async {
|
||||
var res = await CRUD().post(link: AppLink.verifyEmail, payload: {
|
||||
'email': emailController.text.isEmpty
|
||||
? Get.find<LoginCaptinController>().emailController.text.toString()
|
||||
? Get.find<LoginDriverController>().emailController.text.toString()
|
||||
: emailController.text,
|
||||
'token': verifyCode.text,
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
if (Get.find<LoginCaptinController>().emailController.text.toString() !=
|
||||
if (Get.find<LoginDriverController>().emailController.text.toString() !=
|
||||
'') {
|
||||
Get.offAll(() => HomeCaptain());
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,7 @@ class GoogleSignInHelper {
|
||||
if (googleUser != null) {
|
||||
await _handleSignUp(googleUser);
|
||||
// if (box.read(BoxName.countryCode) == 'Egypt') {
|
||||
await Get.find<LoginCaptinController>().loginFromSignInGoogle(
|
||||
await Get.find<LoginDriverController>().loginUsingCredentials(
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.emailDriver).toString(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user