25-5-30/1
This commit is contained in:
@@ -95,17 +95,17 @@ class AiPage extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${'Name'.tr} :${EncryptionHelper.instance.decryptData(contentController.responseMap['first_name'])}',
|
||||
'${'Name'.tr} :${(contentController.responseMap['first_name'])}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
' ${EncryptionHelper.instance.decryptData(contentController.responseMap['last_name'])}',
|
||||
' ${(contentController.responseMap['last_name'])}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'${'Name in arabic'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['name_in_arabic'])}',
|
||||
'${'Name in arabic'.tr}: ${(contentController.responseMap['name_in_arabic'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
@@ -121,7 +121,7 @@ class AiPage extends StatelessWidget {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'National Number'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['id'])}',
|
||||
'${'National Number'.tr}: ${(contentController.responseMap['id'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// Image.memory(
|
||||
@@ -131,7 +131,7 @@ class AiPage extends StatelessWidget {
|
||||
// ),
|
||||
]),
|
||||
Text(
|
||||
'${'Address'.tr}: ${EncryptionHelper.instance.decryptData(contentController.responseMap['address'])}',
|
||||
'${'Address'.tr}: ${(contentController.responseMap['address'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
|
||||
@@ -322,8 +322,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[0]['prompt'].toString()),
|
||||
(ai.prompts[0]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'driver_license'); //egypt
|
||||
},
|
||||
@@ -335,32 +334,30 @@ class EgyptCardAI extends StatelessWidget {
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'License Type'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['license_type'])}',
|
||||
'${'License Type'.tr}: ${(ai.responseIdEgyptDriverLicense['license_type'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'National Number'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['national_number'])}',
|
||||
'${'National Number'.tr}: ${(ai.responseIdEgyptDriverLicense['national_number'])}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptDriverLicense[
|
||||
'national_number']) ==
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptBack['nationalID'])
|
||||
color: (ai.responseIdEgyptDriverLicense[
|
||||
'national_number']) ==
|
||||
(ai.responseIdEgyptBack['nationalID'])
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Name (Arabic)'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['name_arabic'])}',
|
||||
'${'Name (Arabic)'.tr}: ${(ai.responseIdEgyptDriverLicense['name_arabic'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Name (English)'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['name_english'])}',
|
||||
'${'Name (English)'.tr}: ${(ai.responseIdEgyptDriverLicense['name_english'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptDriverLicense['address'])}',
|
||||
'${'Address'.tr}: ${(ai.responseIdEgyptDriverLicense['address'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
@@ -386,11 +383,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[0]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'driver_license'); //egypt
|
||||
await ai.allMethodForAI((ai.prompts[0]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'driver_license'); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -443,8 +437,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[1]['prompt'].toString()),
|
||||
(ai.prompts[1]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'id_back'); //egypt
|
||||
},
|
||||
@@ -457,20 +450,18 @@ class EgyptCardAI extends StatelessWidget {
|
||||
const SizedBox(height: 8.0),
|
||||
// Assuming these keys exist in ai.responseIdEgyptFront
|
||||
Text(
|
||||
'${'National ID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['nationalID'])}',
|
||||
'${'National ID'.tr}: ${(ai.responseIdEgyptBack['nationalID'])}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptDriverLicense[
|
||||
'national_number']) ==
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptBack['nationalID'])
|
||||
color: (ai.responseIdEgyptDriverLicense[
|
||||
'national_number']) ==
|
||||
(ai.responseIdEgyptBack['nationalID'])
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Occupation'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['occupation'])}', // Assuming 'occupation' exists
|
||||
'${'Occupation'.tr}: ${(ai.responseIdEgyptBack['occupation'])}', // Assuming 'occupation' exists
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
@@ -480,7 +471,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
'${'Issue Date'.tr}: ${ai.responseIdEgyptBack['issueDate']}', // Assuming 'issueDate' exists
|
||||
),
|
||||
Text(
|
||||
'${'Gender'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptBack['gender'])}', // Assuming 'gender' exists
|
||||
'${'Gender'.tr}: ${(ai.responseIdEgyptBack['gender'])}', // Assuming 'gender' exists
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -516,11 +507,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[1]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'id_back'); //egypt
|
||||
await ai.allMethodForAI((ai.prompts[1]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'id_back'); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -571,8 +559,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[7]['prompt'].toString()),
|
||||
(ai.prompts[7]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'non_id_back');
|
||||
},
|
||||
@@ -584,16 +571,16 @@ class EgyptCardAI extends StatelessWidget {
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Country'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['country'])}',
|
||||
'${'Country'.tr}: ${(ai.responseNonIdCardBack['country'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Residency Type'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['residencyType'])}',
|
||||
'${'Residency Type'.tr}: ${(ai.responseNonIdCardBack['residencyType'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Work Status'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['workStatus'])}',
|
||||
'${'Work Status'.tr}: ${(ai.responseNonIdCardBack['workStatus'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
@@ -603,7 +590,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
'${'Issue Date'.tr}: ${ai.responseNonIdCardBack['issueDate']}',
|
||||
),
|
||||
Text(
|
||||
'${'Birth Date'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardBack['birthDate'])}',
|
||||
'${'Birth Date'.tr}: ${(ai.responseNonIdCardBack['birthDate'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -623,11 +610,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[7]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'non_id_back');
|
||||
await ai.allMethodForAI((ai.prompts[7]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'non_id_back');
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -670,8 +654,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[2]['id_front'].toString()),
|
||||
(ai.prompts[2]['id_front'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'id_front'); //egypt
|
||||
},
|
||||
@@ -688,10 +671,10 @@ class EgyptCardAI extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'First Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['first_name'])}',
|
||||
'${'First Name'.tr}: ${(ai.responseIdEgyptFront['first_name'])}',
|
||||
),
|
||||
Text(
|
||||
'${'CardID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['card_id'])}',
|
||||
'${'CardID'.tr}: ${(ai.responseIdEgyptFront['card_id'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -700,16 +683,16 @@ class EgyptCardAI extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Full Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['full_name'])}',
|
||||
'${'Full Name'.tr}: ${(ai.responseIdEgyptFront['full_name'])}',
|
||||
),
|
||||
Text(
|
||||
'${'DOB'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['dob'])}',
|
||||
'${'DOB'.tr}: ${(ai.responseIdEgyptFront['dob'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdEgyptFront['address'])}',
|
||||
'${'Address'.tr}: ${(ai.responseIdEgyptFront['address'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
// Text(
|
||||
@@ -726,11 +709,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[2]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'id_front'); //egypt
|
||||
await ai.allMethodForAI((ai.prompts[2]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'id_front'); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -773,8 +753,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[6]['prompt'].toString()),
|
||||
(ai.prompts[6]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'non_id_front');
|
||||
},
|
||||
@@ -786,7 +765,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Full Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['full_name'])}',
|
||||
'${'Full Name'.tr}: ${(ai.responseNonIdCardFront['full_name'])}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
@@ -794,10 +773,10 @@ class EgyptCardAI extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Passport No'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['passport_no'])}',
|
||||
'${'Passport No'.tr}: ${(ai.responseNonIdCardFront['passport_no'])}',
|
||||
),
|
||||
Text(
|
||||
'${'Card ID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['card_id'])}',
|
||||
'${'Card ID'.tr}: ${(ai.responseNonIdCardFront['card_id'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -806,20 +785,20 @@ class EgyptCardAI extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Country'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['country'])}',
|
||||
'${'Country'.tr}: ${(ai.responseNonIdCardFront['country'])}',
|
||||
),
|
||||
Text(
|
||||
'${'Gender'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['gender'])}',
|
||||
'${'Gender'.tr}: ${(ai.responseNonIdCardFront['gender'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Birth Date'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['birthdate'])}',
|
||||
'${'Birth Date'.tr}: ${(ai.responseNonIdCardFront['birthdate'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseNonIdCardFront['address'])}',
|
||||
'${'Address'.tr}: ${(ai.responseNonIdCardFront['address'])}',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -829,11 +808,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[6]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'non_id_front');
|
||||
await ai.allMethodForAI((ai.prompts[6]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'non_id_front');
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -884,8 +860,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[3]['prompt'].toString()),
|
||||
(ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_front');
|
||||
},
|
||||
@@ -899,15 +874,15 @@ class EgyptCardAI extends StatelessWidget {
|
||||
// Removed Make, Model, etc. as they are not available
|
||||
|
||||
Text(
|
||||
'${'Plate Number'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['car_plate'])}',
|
||||
'${'Plate Number'.tr}: ${(ai.responseIdCardDriverEgyptFront['car_plate'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Owner Name'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['owner'])}',
|
||||
'${'Owner Name'.tr}: ${(ai.responseIdCardDriverEgyptFront['owner'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseIdCardDriverEgyptFront['address'])}',
|
||||
'${'Address'.tr}: ${(ai.responseIdCardDriverEgyptFront['address'])}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
@@ -931,11 +906,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_front');
|
||||
ai.allMethodForAI((ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'car_front');
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -1003,8 +975,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[4]['prompt'].toString()),
|
||||
(ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_back');
|
||||
},
|
||||
@@ -1076,11 +1047,8 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_back');
|
||||
ai.allMethodForAI((ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'car_back');
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -1123,8 +1091,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[5]['prompt'].toString()),
|
||||
(ai.prompts[5]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'criminalRecord',
|
||||
);
|
||||
@@ -1140,19 +1107,16 @@ class EgyptCardAI extends StatelessWidget {
|
||||
'${'InspectionResult'.tr}: ${ai.responseCriminalRecordEgypt['InspectionResult']}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'FullName'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['FullName'])}',
|
||||
'${'FullName'.tr}: ${(ai.responseCriminalRecordEgypt['FullName'])}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: EncryptionHelper.instance.decryptData(ai
|
||||
.responseCriminalRecordEgypt['FullName']) ==
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptDriverLicense[
|
||||
'name_arabic'])
|
||||
color: (ai.responseCriminalRecordEgypt['FullName']) ==
|
||||
(ai.responseIdEgyptDriverLicense['name_arabic'])
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'NationalID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'),
|
||||
'${'NationalID'.tr}: ${(ai.responseCriminalRecordEgypt['NationalID'])}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'),
|
||||
@@ -1165,8 +1129,7 @@ class EgyptCardAI extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[5]['prompt'].toString()),
|
||||
(ai.prompts[5]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'criminalRecord',
|
||||
);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_font_icons/flutter_font_icons.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';
|
||||
@@ -10,11 +7,7 @@ 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';
|
||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||
|
||||
import '../../../../controller/functions/crud.dart';
|
||||
import '../../../../controller/functions/encrypt_decrypt.dart';
|
||||
import '../../../../print.dart';
|
||||
import '../../../Rate/rate_app_page.dart';
|
||||
|
||||
class SmsSignupEgypt extends StatelessWidget {
|
||||
|
||||
@@ -36,7 +36,7 @@ class CriminalDocumemtPage extends StatelessWidget {
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () async {
|
||||
if (EncryptionHelper.instance.decryptData(controller
|
||||
if ((controller
|
||||
.responseCriminalRecordEgypt['FullName']) !=
|
||||
box.read(BoxName.nameArabic)) //todo get from server
|
||||
{
|
||||
@@ -141,22 +141,19 @@ Please fill in the JSON object with the extracted information, following these g
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'InspectionResult'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['InspectionResult'])}'),
|
||||
'${'InspectionResult'.tr}: ${(ai.responseCriminalRecordEgypt['InspectionResult'])}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'FullName'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['FullName'])}',
|
||||
'${'FullName'.tr}: ${(ai.responseCriminalRecordEgypt['FullName'])}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: EncryptionHelper.instance.decryptData(ai
|
||||
.responseCriminalRecordEgypt['FullName']) ==
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.responseIdEgyptDriverLicense[
|
||||
'name_arabic'])
|
||||
color: (ai.responseCriminalRecordEgypt['FullName']) ==
|
||||
(ai.responseIdEgyptDriverLicense['name_arabic'])
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'NationalID'.tr}: ${EncryptionHelper.instance.decryptData(ai.responseCriminalRecordEgypt['NationalID'])}'),
|
||||
'${'NationalID'.tr}: ${(ai.responseCriminalRecordEgypt['NationalID'])}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'),
|
||||
|
||||
@@ -390,8 +390,7 @@ class InviteScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
controller.driverInvitationData[index]['invitorName']),
|
||||
(controller.driverInvitationData[index]['invitorName']),
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -447,8 +446,7 @@ class InviteScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(invitation['passengerName'])
|
||||
(invitation['passengerName'])
|
||||
.toString(), // Handle null or missing data
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
@@ -510,9 +508,7 @@ class InviteScreen extends StatelessWidget {
|
||||
_buildStatItem(
|
||||
context,
|
||||
"Active Users".tr,
|
||||
EncryptionHelper.instance
|
||||
.decryptData(controller.driverInvitationDataToPassengers[0]
|
||||
['passengerName'])
|
||||
(controller.driverInvitationDataToPassengers[0]['passengerName'])
|
||||
.toString(),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -336,10 +336,9 @@ class LoginCaptin extends StatelessWidget {
|
||||
box
|
||||
.read(BoxName.driverID)
|
||||
.toString(),
|
||||
EncryptionHelper.instance
|
||||
.encryptData(box
|
||||
.read(BoxName.emailDriver)
|
||||
.toString()),
|
||||
(box
|
||||
.read(BoxName.emailDriver)
|
||||
.toString()),
|
||||
);
|
||||
// Navigate to another screen or perform other actions
|
||||
} else {}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/controller/auth/captin/login_captin_controller.dart';
|
||||
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/auth/captin/cards/sms_signup.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
@@ -50,7 +52,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// '${'Please wait'.tr} $minutesLeft ${"minutes before trying again.".tr}',
|
||||
// '');
|
||||
NotificationController1().showNotification(
|
||||
'Sefer Driver'.tr,
|
||||
'Tripz Driver'.tr,
|
||||
'${'Please wait'.tr} $minutesLeft ${"minutes before trying again.".tr}',
|
||||
'ding',
|
||||
'');
|
||||
@@ -93,46 +95,26 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
)
|
||||
: const SizedBox(),
|
||||
// : const SizedBox(),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(color: AppColor.blueColor),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// print("Current working directory: ${Directory.current.path}");
|
||||
// print(
|
||||
// "pubspec.yaml exists here?: ${await File('${Directory.current.path}/pubspec.yaml').exists()}");
|
||||
|
||||
// try {
|
||||
// await LingoHunter.extractAndCreateTranslationFiles(
|
||||
// baseLang: 'en',
|
||||
// langs: ['ar', 'fr', 'es'],
|
||||
// // Remove projectDirectory: Let it auto-detect.
|
||||
// // projectDirectory: '/Users/hamzaaleghwairyeen/development/App/driver_sefer',
|
||||
// outputDirectory:
|
||||
// '/Users/hamzaaleghwairyeen/development/App/driver_sefer/assets/lang',
|
||||
// additionalRegExps: [
|
||||
// RegExp(r'translate\("([^\"]+)"\)'),
|
||||
// ],
|
||||
// );
|
||||
// print(
|
||||
// "✅ Translation files generated successfully (auto-detected).");
|
||||
// } catch (e) {
|
||||
// print("Error: $e");
|
||||
// }
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.grin_tears,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.blueColor),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
print(box.read(BoxName.paymentLink));
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.grin_tears,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
|
||||
@@ -327,25 +327,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
'driver_id': box.read(BoxName.driverID),
|
||||
});
|
||||
}
|
||||
|
||||
// .then((value) {
|
||||
// var json = jsonDecode(res);
|
||||
if (res == "failure") {
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
"This ride is already taken by another driver."
|
||||
.tr,
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
middleTextStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
// Get.back();
|
||||
}));
|
||||
} else if (jsonDecode(res)['status'] == "success") {
|
||||
if (res != "failure") {
|
||||
box.write(BoxName.statusDriverLocation, 'on');
|
||||
orderRequestController.changeApplied();
|
||||
List<String> bodyToPassenger = [
|
||||
@@ -357,33 +339,29 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
.sendNotificationToPassengerToken(
|
||||
'Accepted Ride',
|
||||
'your ride is applied'.tr,
|
||||
// arguments['DriverList'][9].toString(),
|
||||
orderRequestController
|
||||
.arguments['DriverList'][9]
|
||||
.toString(),
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
'start.wav');
|
||||
await CRUD().postFromDialogue(
|
||||
CRUD().postFromDialogue(
|
||||
link: AppLink.addDriverOrder,
|
||||
payload: {
|
||||
'driver_id': orderRequestController.myList[6]
|
||||
.toString(),
|
||||
// box.read(BoxName.driverID).toString(),
|
||||
'order_id':
|
||||
orderRequestController.body.toString(),
|
||||
'status': 'Apply'
|
||||
});
|
||||
await CRUD().postFromDialogue(
|
||||
link: AppLink.addDriverOrder,
|
||||
payload: {
|
||||
'driver_id': orderRequestController.myList[6]
|
||||
.toString(),
|
||||
// box.read(BoxName.driverID).toString(),
|
||||
'order_id': orderRequestController.myList[16]
|
||||
.toString(),
|
||||
'status': 'Apply'
|
||||
});
|
||||
// CRUD().postFromDialogue(
|
||||
// link: AppLink.addDriverOrder,
|
||||
// payload: {
|
||||
// 'driver_id': orderRequestController.myList[6]
|
||||
// .toString(),
|
||||
// 'order_id': orderRequestController.myList[16]
|
||||
// .toString(),
|
||||
// 'status': 'Apply'
|
||||
// });
|
||||
|
||||
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
@@ -402,9 +380,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
}
|
||||
|
||||
Get.back();
|
||||
|
||||
// 'Arguments passed to PassengerLocationMapPage:');
|
||||
// 'Payment Method: ${orderRequestController.myList[13] == 'true' ? 'visa' : 'cash'}');
|
||||
box.write(BoxName.rideArguments, {
|
||||
'passengerLocation':
|
||||
orderRequestController.myList[0].toString(),
|
||||
@@ -473,6 +448,21 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
});
|
||||
Get.to(() => PassengerLocationMapPage(),
|
||||
arguments: box.read(BoxName.rideArguments));
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
"This ride is already taken by another driver."
|
||||
.tr,
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
middleTextStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
// Get.back();
|
||||
}));
|
||||
}
|
||||
// });
|
||||
// Get.back();
|
||||
|
||||
@@ -195,7 +195,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
_buildPromoCard(
|
||||
title: 'Morning Promo'.tr,
|
||||
timePromo: 'Morning Promo',
|
||||
count: int.parse(captainWalletController
|
||||
count: (captainWalletController
|
||||
.walletDate['message'][0]
|
||||
['morning_count']),
|
||||
maxCount: 5,
|
||||
@@ -208,7 +208,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
_buildPromoCard(
|
||||
timePromo: 'Afternoon Promo',
|
||||
title: 'Afternoon Promo'.tr,
|
||||
count: int.parse(captainWalletController
|
||||
count: (captainWalletController
|
||||
.walletDate['message'][0]
|
||||
['afternoon_count']),
|
||||
maxCount: 5,
|
||||
|
||||
89
lib/views/home/profile/behavior_page.dart
Normal file
89
lib/views/home/profile/behavior_page.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../controller/home/captin/behavior_controller.dart';
|
||||
|
||||
class BehaviorPage extends StatelessWidget {
|
||||
const BehaviorPage({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = Get.put(DriverBehaviorController());
|
||||
controller.fetchDriverBehavior();
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Driver Behavior'.tr),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Obx(() {
|
||||
if (controller.isLoading.value) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
elevation: 4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text("Overall Behavior Score",
|
||||
style: TextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"${controller.overallScore.value.toStringAsFixed(1)} / 100",
|
||||
style: const TextStyle(
|
||||
fontSize: 28, color: Colors.blue)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Text("Last 10 Trips",
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 10),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.lastTrips.length,
|
||||
itemBuilder: (context, index) {
|
||||
var trip = controller.lastTrips[index];
|
||||
return Card(
|
||||
elevation: 3,
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.blue,
|
||||
child: Text("${index + 1}",
|
||||
style: const TextStyle(color: Colors.white)),
|
||||
),
|
||||
title: Text("Trip ID: ${trip['trip_id']}"),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Behavior Score: ${trip['behavior_score']}"),
|
||||
Text("Max Speed: ${trip['max_speed']} km/h"),
|
||||
Text("Hard Brakes: ${trip['hard_brakes']}"),
|
||||
Text("Distance: ${trip['total_distance']} km"),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,7 @@ class CaptainsCars extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4),
|
||||
child: Text(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(
|
||||
car['car_plate']),
|
||||
(car['car_plate']),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -94,11 +94,8 @@ GetBuilder<AI> egyptCarLicenceFront() {
|
||||
style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_front');
|
||||
ai.allMethodForAI((ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'car_front');
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
@@ -142,12 +139,8 @@ GetBuilder<AI> egyptCarLicenceFront() {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAINewCar(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt1,
|
||||
'car_front',
|
||||
'carId'); //todo
|
||||
ai.allMethodForAINewCar((ai.prompts[3]['prompt'].toString()),
|
||||
AppLink.uploadEgypt1, 'car_front', 'carId'); //todo
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -213,11 +206,8 @@ GetBuilder<AI> egyptCarLicenceBack() {
|
||||
Text('Vehicle Details Back'.tr, style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance.decryptData(
|
||||
ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_back');
|
||||
ai.allMethodForAI((ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'car_back');
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
@@ -286,11 +276,8 @@ GetBuilder<AI> egyptCarLicenceBack() {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAI(
|
||||
EncryptionHelper.instance
|
||||
.decryptData(ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt,
|
||||
'car_back');
|
||||
ai.allMethodForAI((ai.prompts[4]['prompt'].toString()),
|
||||
AppLink.uploadEgypt, 'car_back');
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:sefer_driver/controller/profile/captain_profile_controller.dart'
|
||||
import 'package:sefer_driver/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../my_wallet/walet_captain.dart';
|
||||
import 'behavior_page.dart';
|
||||
import 'captains_cars.dart';
|
||||
|
||||
class ProfileCaptain extends StatelessWidget {
|
||||
@@ -33,19 +34,38 @@ class ProfileCaptain extends StatelessWidget {
|
||||
Material(
|
||||
elevation: 2,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
addBankCodeEgypt(captainWalletController);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16, horizontal: 16),
|
||||
child: Text(
|
||||
'Add bank Account'.tr,
|
||||
style: AppStyle.title,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
addBankCodeEgypt(captainWalletController);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16, horizontal: 16),
|
||||
child: Text(
|
||||
'Add bank Account'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
Get.to(() => BehaviorPage());
|
||||
},
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16, horizontal: 16),
|
||||
child: Text(
|
||||
'Show behavior page'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
@@ -73,41 +93,28 @@ class ProfileCaptain extends StatelessWidget {
|
||||
driverId:
|
||||
controller.captainProfileData['driverID'] ??
|
||||
'',
|
||||
name: EncryptionHelper.instance.decryptData(
|
||||
(controller.captainProfileData[
|
||||
'first_name']) ??
|
||||
'') +
|
||||
' ' +
|
||||
EncryptionHelper.instance.decryptData(
|
||||
(controller.captainProfileData[
|
||||
'last_name']) ??
|
||||
''),
|
||||
phoneNumber: EncryptionHelper.instance
|
||||
.decryptData(controller
|
||||
.captainProfileData['phone']) ??
|
||||
name:
|
||||
'${((controller.captainProfileData['first_name']) ?? '')} ${((controller.captainProfileData['last_name']) ?? '')}',
|
||||
phoneNumber:
|
||||
(controller.captainProfileData['phone']) ??
|
||||
'',
|
||||
email: (controller.captainProfileData['email']) ??
|
||||
'',
|
||||
email: EncryptionHelper.instance.decryptData(
|
||||
controller.captainProfileData['email']) ??
|
||||
birthdate: (controller
|
||||
.captainProfileData['birthdate']) ??
|
||||
'',
|
||||
birthdate: EncryptionHelper.instance.decryptData(
|
||||
controller
|
||||
.captainProfileData['birthdate']) ??
|
||||
'',
|
||||
gender: EncryptionHelper.instance.decryptData(
|
||||
controller
|
||||
.captainProfileData['gender']) ??
|
||||
'',
|
||||
education: EncryptionHelper.instance.decryptData(
|
||||
controller
|
||||
.captainProfileData['education']) ??
|
||||
gender:
|
||||
(controller.captainProfileData['gender']) ??
|
||||
'',
|
||||
education: (controller
|
||||
.captainProfileData['education']) ??
|
||||
'',
|
||||
carMake:
|
||||
controller.captainProfileData['make'] ?? '',
|
||||
carModel:
|
||||
controller.captainProfileData['model'] ?? '',
|
||||
carPlate: EncryptionHelper.instance.decryptData(
|
||||
controller
|
||||
.captainProfileData['car_plate']) ??
|
||||
carPlate: (controller
|
||||
.captainProfileData['car_plate']) ??
|
||||
'',
|
||||
carColor:
|
||||
controller.captainProfileData['color'] ?? '',
|
||||
|
||||
@@ -251,20 +251,7 @@ class RideAvailableCard extends StatelessWidget {
|
||||
|
||||
// .then((value) {
|
||||
// var json = jsonDecode(res);
|
||||
if (res == "failure") {
|
||||
MyDialog().getDialog(
|
||||
"This ride is already taken by another driver.".tr, '', () {
|
||||
CRUD().post(
|
||||
link: AppLink.deleteAvailableRide, payload: {'id': rideInfo['id']});
|
||||
if (AppLink.endPoint.toString() != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
link:
|
||||
'${AppLink.endPoint}/ride/notificationCaptain/deleteAvailableRide.php',
|
||||
payload: {'id': rideInfo['id']});
|
||||
}
|
||||
Get.back();
|
||||
});
|
||||
} else if (jsonDecode(res)['status'] == "success") {
|
||||
if (res != "failure") {
|
||||
List<String> bodyToPassenger = [
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.nameDriver).toString(),
|
||||
@@ -273,7 +260,6 @@ class RideAvailableCard extends StatelessWidget {
|
||||
box.write(BoxName.statusDriverLocation, 'on');
|
||||
await CRUD().postFromDialogue(link: AppLink.addDriverOrder, payload: {
|
||||
'driver_id': box.read(BoxName.driverID),
|
||||
// box.read(BoxName.driverID).toString(),
|
||||
'order_id': rideInfo['id'],
|
||||
'status': 'Apply'
|
||||
});
|
||||
@@ -349,6 +335,19 @@ class RideAvailableCard extends StatelessWidget {
|
||||
'carType': rideInfo['carType'].toString(),
|
||||
'kazan': Get.find<HomeCaptainController>().kazan.toString(),
|
||||
});
|
||||
} else {
|
||||
MyDialog().getDialog(
|
||||
"This ride is already taken by another driver.".tr, '', () {
|
||||
CRUD().post(
|
||||
link: AppLink.deleteAvailableRide, payload: {'id': rideInfo['id']});
|
||||
if (AppLink.endPoint.toString() != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
link:
|
||||
'${AppLink.endPoint}/ride/notificationCaptain/deleteAvailableRide.php',
|
||||
payload: {'id': rideInfo['id']});
|
||||
}
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user