This commit is contained in:
Hamza-Ayed
2024-07-16 18:13:40 +03:00
parent 4ffaa591fa
commit e6305f4ddc
9 changed files with 246 additions and 140 deletions

View File

@@ -101,8 +101,8 @@ class InviteController extends GetxController {
'${'before'.tr} *${d['message']['expirationTime'].toString()}*\n\n'
'_*${d['message']['inviteCode'].toString()}*_\n\n'
'${"Install our app:".tr}\n'
'Android: https://play.google.com/store/apps/details?id=com.sefer_driver\n'
'iOS: https://apps.apple.com/ae/app/sefer-driver/id6502189302';
'*Android:* https://play.google.com/store/apps/details?id=com.sefer_driver\n\n\n'
'*iOS:* https://apps.apple.com/ae/app/sefer-driver/id6502189302';
launchCommunication(
'whatsapp', '+2${invitePhoneController.text}', message);

View File

@@ -25,11 +25,32 @@ class AI extends GetxController {
bool approved = false;
bool isDriverSaved = false;
bool isCarSaved = false;
bool isInviteDriverFound = false;
final invitationCodeController = TextEditingController();
final formKey = GlobalKey<FormState>();
void setApproved() {
approved = true;
update();
}
Future updateInvitationCodeFromRegister() async {
if (formKey.currentState!.validate()) {
var res = await CRUD().post(
link: AppLink.updateInvitationCodeFromRegister,
payload: {"inviteCode": invitationCodeController.text});
if (res != 'failure') {
isInviteDriverFound = true;
update();
Get.snackbar("Code approved".tr, '',
backgroundColor: AppColor.greenColor);
} else {
Get.snackbar("Code not approved".tr, '',
backgroundColor: AppColor.redColor);
}
}
}
final today = DateTime.now();
Future<void> addDriverAndCarEgypt() async {
@@ -48,7 +69,7 @@ class AI extends GetxController {
taxExpiryDateTime != null && taxExpiryDateTime.isBefore(today);
// Check if the inspection date is before today
final inspectionDateTime = DateTime(year, 1, 1);
final inspectionDateTime = DateTime(year, 12, 31);
final isInspectionExpired = inspectionDateTime.isBefore(today);
if (isExpiredCar || isInspectionExpired) {
@@ -60,7 +81,7 @@ class AI extends GetxController {
const Icon(Icons.warning, size: 48, color: Colors.red),
const SizedBox(height: 16),
Text(
'Your drivers license and/or car tax has expired. Please renew them before proceeding.'
"Your drivers license and/or car tax has expired. Please renew them before proceeding."
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
@@ -69,7 +90,7 @@ class AI extends GetxController {
IconButton(
onPressed: () async {
await Get.find<TextToSpeechController>().speakText(
'Your drivers license and/or car tax has expired. Please renew them before proceeding.'
"Your drivers license and/or car tax has expired. Please renew them before proceeding."
.tr,
);
},
@@ -95,7 +116,7 @@ class AI extends GetxController {
const Icon(Icons.warning, size: 48, color: Colors.red),
const SizedBox(height: 16),
Text(
'Your drivers license has expired. Please renew it before proceeding.'
"Your drivers license has expired. Please renew it before proceeding."
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
@@ -104,9 +125,8 @@ class AI extends GetxController {
IconButton(
onPressed: () async {
await Get.find<TextToSpeechController>().speakText(
'Your drivers license has expired. Please renew it before proceeding.'
.tr,
);
"Your drivers license has expired. Please renew it before proceeding."
.tr);
},
icon: const Icon(Icons.volume_up),
),
@@ -132,7 +152,7 @@ class AI extends GetxController {
const Icon(Icons.warning, size: 48, color: Colors.red),
const SizedBox(height: 16),
Text(
'The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents.'
"The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents."
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
@@ -141,7 +161,8 @@ class AI extends GetxController {
IconButton(
onPressed: () async {
await Get.find<TextToSpeechController>().speakText(
'The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents.',
"The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents."
.tr,
);
},
icon: const Icon(Icons.volume_up),

View File

@@ -4,6 +4,12 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
"ID Documents Front": "الوثيقه الشخصية - الأمامية",
"Vehicle Details Front": "تفاصيل المركبة - الأمامية",
"Vehicle Details Back": "تفاصيل المركبة - الخلفية",
"Criminal Record": "السجل الجنائي",
"ID Documents Back": "الوثيقه الشخصية - الخلفية",
"Driver's License": "رخصة القيادة",
"you can show video how to setup":
"يمكنك عرض فيديو حول كيفية الإعداد",
"don't start trip if not": "لا تبدأ الرحلة إذا لم",
@@ -248,6 +254,13 @@ class MyTranslation extends Translations {
"National ID": "الهوية الوطنية",
"Occupation": "المهنة",
"Gender": "الجنس",
"Your drivers license and/or car tax has expired. Please renew them before proceeding.":
"لقد انتهت صلاحية رخصة القيادة و/أو ضريبة السيارة الخاصة بك. يرجى تجديدها قبل المتابعة.",
"Your drivers license has expired. Please renew it before proceeding.":
"لقد انتهت صلاحية رخصة القيادة الخاصة بك. يرجى تجديدها قبل المتابعة.",
"The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents.":
"الرقم الوطني على رخصة القيادة الخاصة بك لا يتطابق مع الرقم الموجود على مستند الهوية. يرجى التحقق وتقديم المستندات الصحيحة.",
"Religion": "الدين",
"You have 500": "لديك 500",
"You have got a gift for invitation": "لقد حصلت على هدية للدعوة",
@@ -257,7 +270,13 @@ class MyTranslation extends Translations {
"for your first registration!": "للتسجيل الأول!",
"Get it Now!": "احصل عليه الآن!",
"before": "قبل",
"Code not approved": "الرمز غير موافق عليه",
"3000 LE": "3000 جنيه مصري",
"Do you have an invitation code from another driver?":
"هل لديك كود دعوة من سائق آخر؟",
"Paste the code here": "الصق الكود هنا",
"No, I don't have a code": "لا، لا أملك كودا",
"Code approved": "تمت الموافقة على الكود",
"Install our app:": "قم بتثبيت تطبيقنا:",
"Invite another driver and both get a gift after he completes 100 trips!":
"ادع صديقًا ليكون سائقًا واحصلا على هدية بعد إكماله 100 مشوار!",

View File

@@ -54,8 +54,10 @@ class DriverWalletHistoryController extends GetxController {
Get.back();
},
));
} else {
weeklyList = jsonDecode(res)['message'];
}
weeklyList = jsonDecode(res)['message'];
isLoading = false;
update();
}