7/16/1
This commit is contained in:
@@ -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 driver’s license and/or car tax has expired. Please renew them before proceeding.'
|
||||
"Your driver’s 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 driver’s license and/or car tax has expired. Please renew them before proceeding.'
|
||||
"Your driver’s 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 driver’s license has expired. Please renew it before proceeding.'
|
||||
"Your driver’s 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 driver’s license has expired. Please renew it before proceeding.'
|
||||
.tr,
|
||||
);
|
||||
"Your driver’s 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 driver’s license does not match the one on your ID document. Please verify and provide the correct documents.'
|
||||
"The national number on your driver’s 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 driver’s license does not match the one on your ID document. Please verify and provide the correct documents.',
|
||||
"The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents."
|
||||
.tr,
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.volume_up),
|
||||
|
||||
Reference in New Issue
Block a user