25-1/13/1-securejordan

This commit is contained in:
Hamza-Ayed
2025-01-13 22:10:47 +03:00
parent e8c3f8f339
commit a893e49282
36 changed files with 803 additions and 447 deletions

View File

@@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../../../../constant/colors.dart';
import '../../../../constant/links.dart';
import '../../../../constant/style.dart';
import '../../../../controller/functions/encrypt_decrypt.dart';
import '../../../../controller/functions/package_info.dart';
import '../../../../main.dart';
import '../../../widgets/my_scafold.dart';
@@ -321,7 +322,8 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[0]['prompt'].toString(),
encryptionHelper.encryptData(
ai.prompts[0]['prompt'].toString()),
AppLink.uploadEgypt,
'driver_license'); //egypt
},
@@ -382,8 +384,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
await ai.allMethodForAI(ai.prompts[0]['prompt'].toString(),
AppLink.uploadEgypt, 'driver_license'); //egypt
await ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[0]['prompt'].toString()),
AppLink.uploadEgypt,
'driver_license'); //egypt
},
child: Column(
children: [
@@ -436,7 +441,8 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[1]['prompt'].toString(),
encryptionHelper.encryptData(
ai.prompts[1]['prompt'].toString()),
AppLink.uploadEgypt,
'id_back'); //egypt
},
@@ -506,8 +512,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
await ai.allMethodForAI(ai.prompts[1]['prompt'].toString(),
AppLink.uploadEgypt, 'id_back'); //egypt
await ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[1]['prompt'].toString()),
AppLink.uploadEgypt,
'id_back'); //egypt
},
child: Column(
children: [
@@ -558,7 +567,9 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[7]['prompt'].toString(),
encryptionHelper.decryptData(
encryptionHelper.encryptData(
ai.prompts[7]['prompt'].toString())),
AppLink.uploadEgypt,
'non_id_back');
},
@@ -609,8 +620,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
await ai.allMethodForAI(ai.prompts[7]['prompt'].toString(),
AppLink.uploadEgypt, 'non_id_back');
await ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[7]['prompt'].toString()),
AppLink.uploadEgypt,
'non_id_back');
},
child: Column(
children: [
@@ -653,7 +667,8 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[2]['id_front'].toString(),
encryptionHelper.encryptData(
ai.prompts[2]['id_front'].toString()),
AppLink.uploadEgypt,
'id_front'); //egypt
},
@@ -708,8 +723,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
await ai.allMethodForAI(ai.prompts[2]['prompt'].toString(),
AppLink.uploadEgypt, 'id_front'); //egypt
await ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[2]['prompt'].toString()),
AppLink.uploadEgypt,
'id_front'); //egypt
},
child: Column(
children: [
@@ -752,7 +770,8 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[6]['prompt'].toString(),
encryptionHelper.encryptData(
ai.prompts[6]['prompt'].toString()),
AppLink.uploadEgypt,
'non_id_front');
},
@@ -807,8 +826,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
await ai.allMethodForAI(ai.prompts[6]['prompt'].toString(),
AppLink.uploadEgypt, 'non_id_front');
await ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[6]['prompt'].toString()),
AppLink.uploadEgypt,
'non_id_front');
},
child: Column(
children: [
@@ -858,8 +880,11 @@ class EgyptCardAI extends StatelessWidget {
style: AppStyle.headTitle2),
IconButton(
onPressed: () async {
ai.allMethodForAI(ai.prompts[3]['prompt'].toString(),
AppLink.uploadEgypt, 'car_front');
ai.allMethodForAI(
encryptionHelper.encryptData(
ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt,
'car_front');
},
icon: const Icon(Icons.refresh),
),
@@ -903,8 +928,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
ai.allMethodForAI(ai.prompts[3]['prompt'].toString(),
AppLink.uploadEgypt, 'car_front');
ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[3]['prompt'].toString()),
AppLink.uploadEgypt,
'car_front');
},
child: Column(
children: [
@@ -971,8 +999,11 @@ class EgyptCardAI extends StatelessWidget {
style: AppStyle.headTitle2),
IconButton(
onPressed: () async {
ai.allMethodForAI(ai.prompts[4]['prompt'].toString(),
AppLink.uploadEgypt, 'car_back');
ai.allMethodForAI(
encryptionHelper.encryptData(
ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt,
'car_back');
},
icon: const Icon(Icons.refresh),
),
@@ -1042,8 +1073,11 @@ class EgyptCardAI extends StatelessWidget {
return Card(
child: InkWell(
onTap: () async {
ai.allMethodForAI(ai.prompts[4]['prompt'].toString(),
AppLink.uploadEgypt, 'car_back');
ai.allMethodForAI(
encryptionHelper
.encryptData(ai.prompts[4]['prompt'].toString()),
AppLink.uploadEgypt,
'car_back');
},
child: Column(
children: [
@@ -1086,7 +1120,8 @@ class EgyptCardAI extends StatelessWidget {
IconButton(
onPressed: () async {
await ai.allMethodForAI(
ai.prompts[5]['prompt'].toString(),
encryptionHelper.encryptData(
ai.prompts[5]['prompt'].toString()),
AppLink.uploadEgypt,
'criminalRecord',
);
@@ -1124,7 +1159,8 @@ class EgyptCardAI extends StatelessWidget {
child: InkWell(
onTap: () async {
await ai.allMethodForAI(
ai.prompts[5]['prompt'].toString(),
encryptionHelper
.encryptData(ai.prompts[5]['prompt'].toString()),
AppLink.uploadEgypt,
'criminalRecord',
);

View File

@@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../../../controller/auth/captin/invit_controller.dart';
import '../../../controller/functions/encrypt_decrypt.dart';
class InviteScreen extends StatelessWidget {
final InviteController controller = Get.put(InviteController());
@@ -367,8 +368,9 @@ class InviteScreen extends StatelessWidget {
}
Widget _buildInvitationItem(BuildContext context, int index) {
int countOfInvitDriver = int.tryParse(controller.driverInvitationData[index]
['countOfInvitDriver']
int countOfInvitDriver = int.tryParse(encryptionHelper
.decryptData(controller.driverInvitationData[index]
['countOfInvitDriver'])
?.toString() ??
'0') ??
0;
@@ -389,7 +391,8 @@ class InviteScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
controller.driverInvitationData[index]['invitorName'],
encryptionHelper.decryptData(
controller.driverInvitationData[index]['invitorName']),
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
@@ -425,8 +428,11 @@ class InviteScreen extends StatelessWidget {
// Extracting the data from the sample JSON-like structure
var invitation = controller.driverInvitationDataToPassengers[index];
int countOfInvitDriver =
int.tryParse(invitation['countOfInvitDriver']?.toString() ?? '0') ?? 0;
int countOfInvitDriver = int.tryParse(encryptionHelper
.decryptData(invitation['countOfInvitDriver'])
?.toString() ??
'0') ??
0;
double progressValue = (countOfInvitDriver / 10.0).clamp(0.0, 1.0);
return GestureDetector(
@@ -444,7 +450,8 @@ class InviteScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
invitation['passengerName']
encryptionHelper
.decryptData(invitation['passengerName'])
.toString(), // Handle null or missing data
style: const TextStyle(
fontSize: 17,
@@ -499,13 +506,17 @@ class InviteScreen extends StatelessWidget {
_buildStatItem(
context,
"Total Invites".tr,
controller.driverInvitationDataToPassengers[0]['countOfInvitDriver']
encryptionHelper
.decryptData(controller.driverInvitationDataToPassengers[0]
['countOfInvitDriver'])
.toString(),
),
_buildStatItem(
context,
"Active Users".tr,
controller.driverInvitationDataToPassengers[0]['passengerName']
encryptionHelper
.decryptData(controller.driverInvitationDataToPassengers[0]
['passengerName'])
.toString(),
),
],