This commit is contained in:
Hamza-Ayed
2024-06-28 19:09:55 +03:00
parent 715726a52d
commit 6fb79baab4
17 changed files with 332 additions and 315 deletions

View File

@@ -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: {

View File

@@ -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 {

View File

@@ -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(),
);

View File

@@ -18,7 +18,7 @@ class SmsEgyptController extends GetxController {
"password": AK.smsPasswordEgypt, //'E)Pu=an/@Z',
"message": "${AppInformation.appName} app code is $otp\ncopy it to app",
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
"sender": "SEFER EGY", // todo add sefer sender name
"sender": "Sefer Egy", // todo add sefer sender name
"receiver": "2$phone"
});
@@ -30,7 +30,7 @@ class SmsEgyptController extends GetxController {
if (res.statusCode == 200) {
Get.defaultDialog(
title: 'You will recieve code in sms message'.tr,
title: 'You will receive code in sms message'.tr,
middleText: '',
confirm: MyElevatedButton(
title: 'OK'.tr,

View File

@@ -19,7 +19,7 @@ class HelpController extends GetxController {
String status = '';
String qustion = '';
late int indexQuestion = 0;
getindex(int i, String qustion1) async {
getIndex(int i, String qustion1) async {
indexQuestion = i;
qustion = qustion1;
update();
@@ -56,12 +56,22 @@ class HelpController extends GetxController {
title: 'There is no help Question here'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Back'.tr,
onPressed: () {
Get.back();
Get.back();
}));
confirm: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'Add Question'.tr,
onPressed: () {
Get.back();
}),
MyElevatedButton(
title: 'Back'.tr,
onPressed: () {
Get.back();
Get.back();
}),
],
));
}
helpQuestionDate = jsonDecode(res);
isLoading = false;

View File

@@ -54,7 +54,7 @@ class SplashScreenController extends GetxController
: box.read(BoxName.emailDriver) != null &&
box.read(BoxName.phoneDriver) != null &&
box.read(BoxName.phoneVerified) == '1'
? await Get.put(LoginCaptinController()).loginFromSignInGoogle(
? await Get.put(LoginDriverController()).loginUsingCredentials(
box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver))
: Get.off(() => LoginCaptin());

View File

@@ -4,6 +4,7 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
'Add Question': '',
"Please enter a valid card 16-digit number.":
"الرجاء إدخال رقم بطاقة صحيح مكون من 16 رقمًا.",
"Insert card number": "أدخل رقم البطاقة",
@@ -115,7 +116,7 @@ class MyTranslation extends Translations {
"birthdate": "تاريخ ميلاد",
"Approve Driver Documents": "الموافقة على مستندات الشريك السائق",
"Total Budget is": "الميزانية الإجمالية",
"You will recieve code in sms message":
"You will receive code in sms message":
"ستتلقى الرمز في رسالة نصية قصيرة",
"Please enter": "الرجاء إدخال",
"We need your phone number to contact you and to help you receive orders.":

View File

@@ -89,7 +89,7 @@ class RateController extends GetxController {
'Wallet Added',
'Wallet Added'.tr,
Get.find<MapDriverController>().tokenPassenger);
walletChecked == 'true';
walletChecked = 'true';
update();
}
});