This commit is contained in:
Hamza-Ayed
2024-12-18 16:39:57 +03:00
parent 0129162309
commit 90d4ca39bf
138 changed files with 1581 additions and 1162 deletions

View File

@@ -1,8 +1,10 @@
import 'package:SEFER/controller/functions/gemeni.dart';
import 'package:SEFER/controller/functions/tts.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_circular_indicator_timer.dart';
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:sefer_driver/constant/box_name.dart';
import 'package:sefer_driver/controller/functions/gemeni.dart';
import 'package:sefer_driver/controller/functions/tts.dart';
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
import 'package:sefer_driver/views/widgets/my_circular_indicator_timer.dart';
import 'package:sefer_driver/views/widgets/my_textField.dart';
import 'package:sefer_driver/views/widgets/mydialoug.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -10,6 +12,7 @@ import '../../../../constant/colors.dart';
import '../../../../constant/links.dart';
import '../../../../constant/style.dart';
import '../../../../controller/functions/package_info.dart';
import '../../../../main.dart';
import '../../../widgets/my_scafold.dart';
class EgyptCardAI extends StatelessWidget {
@@ -36,6 +39,11 @@ class EgyptCardAI extends StatelessWidget {
}),
body: [
GetBuilder<AI>(builder: (controller) {
if (box.read(BoxName.isInstall) != null ||
box.read(BoxName.isInstall).toString() != '') {
controller.updateInvitationCodeFromRegister();
}
return controller.isLoading
? MyCircularProgressIndicatorWithTimer(
isLoading: controller.isLoading,
@@ -117,153 +125,134 @@ class EgyptCardAI extends StatelessWidget {
right: 30,
left: 30,
child: GetBuilder<AI>(builder: (controller) {
return controller.isInviteDriverFound == false
? Padding(
padding: const EdgeInsets.symmetric(vertical: 60),
child: Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
"Do you have an invitation code from another driver?"
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
const SizedBox(
height: 30,
),
Form(
key: controller.formKey,
child: MyTextForm(
controller:
controller.invitationCodeController,
label: "Paste the code here".tr,
hint: "Paste the code here".tr,
type: TextInputType.name,
return controller.approved == false
? Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'Approve Driver Documents'.tr,
style: AppStyle.title,
),
const SizedBox(height: 8),
Text(
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
Container(
decoration: AppStyle.boxDecoration1,
child: TextButton.icon(
onPressed: () async {
controller.startTimer();
await textToSpeechController.speakText(
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
.tr);
},
icon: const Icon(
Icons.headphones,
size: 50,
),
label: Text(
'Press to hear'.tr,
style: AppStyle.title,
),
),
const SizedBox(
height: 30,
),
MyElevatedButton(
title: 'Ok'.tr,
onPressed: () async {
controller
.updateInvitationCodeFromRegister();
}),
MyElevatedButton(
kolor: AppColor.yellowColor,
title: "No, I don't have a code".tr,
onPressed: () {
controller.isInviteDriverFound = true;
controller.update();
})
],
),
),
const SizedBox(height: 8),
// textToSpeechController.isComplete
// ? Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceAround,
// children: [
// MyElevatedButton(
// title: 'OK'.tr,
// kolor: AppColor.greenColor,
// onPressed: () {
// controller.setApproved();
// }),
// MyElevatedButton(
// title: 'cancel'.tr,
// kolor: AppColor.redColor,
// onPressed: () {
// Get.defaultDialog(
// title:
// 'You will cancel registeration'
// .tr,
// middleText: '',
// content: IconButton(
// onPressed: () async {
// await textToSpeechController
// .speakText(
// 'You will cancel registeration'
// .tr);
// },
// icon: const Icon(
// Icons.headphones),
// ),
// confirm: MyElevatedButton(
// title: 'OK'.tr,
// kolor: AppColor.redColor,
// onPressed: () {
// Get.back();
// Get.back();
// }),
// cancel: MyElevatedButton(
// title: 'Cancel'.tr,
// kolor: AppColor.greenColor,
// onPressed: () {
// Get.back();
// }));
// }),
// ],
// )
// : const SizedBox()
controller.isTimerComplete
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'Ok'.tr,
kolor: AppColor.greenColor,
onPressed: () {
controller.setApproved();
}),
MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
MyDialog().getDialog(
'You will cancel registration'
.tr,
'', () async {
Get.back();
Get.back();
});
}),
],
)
: Column(
children: [
CircularProgressIndicator(
value: controller.progressValue,
),
Text(
'${'Remaining time'.tr}: ${controller.remainingSeconds} ${"seconds".tr}',
),
],
),
],
),
),
)
: controller.approved == false
? Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'Approve Driver Documents'.tr,
style: AppStyle.title,
),
const SizedBox(height: 8),
Text(
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
Container(
decoration: AppStyle.boxDecoration1,
child: TextButton.icon(
onPressed: () async {
await textToSpeechController.speakText(
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
.tr);
},
icon: const Icon(
Icons.headphones,
size: 50,
),
label: Text(
'Press to hear'.tr,
style: AppStyle.title,
),
),
),
const SizedBox(height: 8),
GetBuilder<TextToSpeechController>(
builder: (textToSpeechController) {
return textToSpeechController.isComplete
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'OK'.tr,
kolor: AppColor.greenColor,
onPressed: () {
controller.setApproved();
}),
MyElevatedButton(
title: 'cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.defaultDialog(
title:
'You will cancel registeration'
.tr,
middleText: '',
content: IconButton(
onPressed: () async {
await textToSpeechController
.speakText(
'You will cancel registeration'
.tr);
},
icon: const Icon(
Icons.headphones),
),
confirm: MyElevatedButton(
title: 'OK'.tr,
kolor:
AppColor.redColor,
onPressed: () {
Get.back();
Get.back();
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor
.greenColor,
onPressed: () {
Get.back();
}));
}),
],
)
: const SizedBox();
})
],
),
),
)
: const SizedBox();
: const SizedBox();
}),
)
],

View File

@@ -1,10 +1,10 @@
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:sefer_driver/constant/colors.dart';
import 'package:sefer_driver/constant/style.dart';
import 'package:sefer_driver/controller/auth/captin/register_captin_controller.dart';
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
import 'package:sefer_driver/views/widgets/my_scafold.dart';
import 'package:sefer_driver/views/widgets/my_textField.dart';
import 'package:sefer_driver/views/widgets/mycircular.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';