25-1/28/1

This commit is contained in:
Hamza-Ayed
2025-01-28 01:03:04 +03:00
parent 46709df1e6
commit 9b0650b118
84 changed files with 416 additions and 830 deletions

View File

@@ -121,100 +121,103 @@ class SmsSignupEgypt extends StatelessWidget {
Get.to(RatingScreen());
}),
),
IconButton(
onPressed: () async {
// final plainText =
// 'https://server.sefer.live/sefer.click/sefer';
// debugPrint('Plain Text: $plainText');
// Encrypt the data
// final encryptedData = encryptionHelper.encryptData(plainText);
// debugPrint('Encrypted: $encryptedData');
// IconButton(
// onPressed: () async {
// // final plainText =
// // 'https://server.sefer.live/sefer.click/sefer';
// // debugPrint('Plain Text: $plainText');
// Decrypt the data
// final decryptedData = encryptionHelper.decryptData(
// encryptedData); // Use the encryptedData variable
// debugPrint('Decrypted: $decryptedData');
// box.remove('DriversSecure');
var drivers0 = await CRUD().get(
link:
'https://server.sefer.live/sefer.click/sefer/auth/captin/getAllDriverSecure.php',
payload: {});
var decodedDriver;
if (drivers0 != 'failure') {
decodedDriver = jsonDecode(drivers0);
// // Encrypt the data
// // final encryptedData = encryptionHelper.encryptData(plainText);
// // debugPrint('Encrypted: $encryptedData');
// box.write('DriversSecure', decodedDriver['message']);
}
var drivers = decodedDriver['message'];
Log.print('drivers.length: ${drivers.length}');
for (var i = 0; i < drivers.length; i++) {
Log.print('drivers: ${drivers[i]['id']}');
var payload = {
"phone": encryptionHelper
.encryptData(drivers[i]['phone'].toString()),
"email": encryptionHelper
.encryptData(drivers[i]['email'].toString()),
"gender": encryptionHelper
.encryptData(drivers[i]['gender'].toString()),
"license_type": encryptionHelper
.encryptData(drivers[i]['license_type'].toString()),
"national_number": encryptionHelper.encryptData(
drivers[i]['national_number'].toString()),
"name_arabic": encryptionHelper
.encryptData(drivers[i]['name_arabic'].toString()),
"name_english": encryptionHelper
.encryptData(drivers[i]['name_english'].toString()),
"address": encryptionHelper
.encryptData(drivers[i]['address'].toString()),
"card_id": encryptionHelper
.encryptData(drivers[i]['card_id'].toString()),
"occupation": encryptionHelper
.encryptData(drivers[i]['occupation'].toString()),
"religion": encryptionHelper
.encryptData(drivers[i]['religion'].toString()),
"birthdate": encryptionHelper
.encryptData(drivers[i]['birthdate'].toString()),
"site": encryptionHelper
.encryptData(drivers[i]['site'].toString()),
"first_name": encryptionHelper
.encryptData(drivers[i]['first_name'].toString()),
"last_name": encryptionHelper
.encryptData(drivers[i]['last_name'].toString()),
"education": encryptionHelper
.encryptData(drivers[i]['education'].toString()),
"employmentType": encryptionHelper
.encryptData(drivers[i]['employmentType'].toString()),
"maritalStatus": (drivers[i]['maritalStatus'].toString()),
"fullNameMaritial": encryptionHelper.encryptData(
drivers[i]['fullNameMaritial'].toString()),
'id': drivers[i]['id'].toString()
};
print(payload);
// if (drivers[i]['id'].toString() !=
// '01002165502a9sHC1tbrUrUw') {
var result = await CRUD().post(
link:
'https://server.sefer.live/sefer.click/sefer/auth/captin/updateDriverSecure.php',
payload: payload);
if (result != 'failure') {
print(result);
} else {
print('failure');
}
Future.delayed(Duration(microseconds: 200));
// }
}
MyDialog().getDialog('title', 'midTitle', () {
Get.back();
});
},
icon: const Icon(
FontAwesome5.grin_tears,
size: 29,
color: AppColor.blueColor,
),
),
// // Decrypt the data
// // final decryptedData = encryptionHelper.decryptData(
// // '2unGmj8jSMFBfxqH8+GN'); // Use the encryptedData variable
// // debugPrint('Decrypted: $decryptedData');
// // box.remove('DriversSecure');
// var drivers0 = await CRUD().get(
// link:
// 'https://server.sefer.live/sefer.click/sefer/auth/captin/getAllDriverSecure.php',
// payload: {});
// var decodedDriver;
// if (drivers0 != 'failure') {
// decodedDriver = jsonDecode(drivers0);
// // // // box.write('DriversSecure', decodedDriver['message']);
// }
// var drivers = decodedDriver['message'];
// Log.print('drivers.length: ${drivers.length}');
// for (var i = 0; i < drivers.length; i++) {
// Log.print('id: ${drivers[i]['id']}');
// var payload = {
// "phone": encryptionHelper
// .encryptData(drivers[i]['phone'].toString()),
// "email": encryptionHelper
// .encryptData(drivers[i]['email'].toString()),
// "gender": encryptionHelper
// .encryptData(drivers[i]['gender'] ?? 'unknown'),
// "birthdate": encryptionHelper
// .encryptData(drivers[i]['birthdate'].toString()),
// "first_name": encryptionHelper
// .encryptData(drivers[i]['first_name'].toString()),
// "last_name": encryptionHelper
// .encryptData(drivers[i]['last_name'].toString()),
// "sosPhone": encryptionHelper
// .encryptData(drivers[i]['sosPhone'].toString()),
// // "name_english": encryptionHelper
// // .encryptData(drivers[i]['name_english'].toString()),
// // "last_name": encryptionHelper
// // .encryptData(drivers[i]['last_name'].toString()),
// // "sosPhone": encryptionHelper
// // .encryptData(drivers[i]['sosPhone'].toString()),
// // "address": encryptionHelper
// // .encryptData(drivers[i]['address'].toString()),
// // "card_id": encryptionHelper
// // .encryptData(drivers[i]['card_id'].toString()),
// // "occupation": encryptionHelper
// // .encryptData(drivers[i]['occupation'].toString()),
// // "religion": encryptionHelper
// // .encryptData(drivers[i]['religion'].toString()),
// // "site": encryptionHelper
// // .encryptData(drivers[i]['site'].toString()),
// // "education": encryptionHelper
// // .encryptData(drivers[i]['education'].toString()),
// // "accountBank": encryptionHelper
// // .encryptData(drivers[i]['accountBank'].toString()),
// // "employmentType": encryptionHelper
// // .encryptData(drivers[i]['employmentType'].toString()),
// // "maritalStatus": (drivers[i]['maritalStatus'].toString()),
// // "fullNameMaritial": encryptionHelper.encryptData(
// // drivers[i]['fullNameMaritial'].toString()),
// 'id': drivers[i]['id'].toString()
// };
// // print(drivers[i]['idn']);
// // if (drivers[i]['id'].toString() !=
// // '01002165502a9sHC1tbrUrUw') {
// var result = await CRUD().post(
// link:
// 'https://server.sefer.live/sefer.click/sefer/auth/captin/updateDriverSecure.php',
// payload: payload);
// if (result != 'failure') {
// print(result);
// } else {
// print('failure');
// }
// // Future.delayed(Duration(microseconds: 200));
// // }
// }
// MyDialog().getDialog('title', 'midTitle', () {
// Get.back();
// });
// },
// icon: const Icon(
// FontAwesome5.grin_tears,
// size: 29,
// color: AppColor.blueColor,
// ),
// ),
],
);
}),

View File

@@ -368,11 +368,10 @@ class InviteScreen extends StatelessWidget {
}
Widget _buildInvitationItem(BuildContext context, int index) {
int countOfInvitDriver = int.tryParse(encryptionHelper
.decryptData(controller.driverInvitationData[index]
['countOfInvitDriver'])
?.toString() ??
'0') ??
int countOfInvitDriver = int.tryParse(
(controller.driverInvitationData[index]['countOfInvitDriver'])
?.toString() ??
'0') ??
0;
double progressValue = (countOfInvitDriver / 100.0).clamp(0.0, 1.0);
@@ -428,11 +427,9 @@ class InviteScreen extends StatelessWidget {
// Extracting the data from the sample JSON-like structure
var invitation = controller.driverInvitationDataToPassengers[index];
int countOfInvitDriver = int.tryParse(encryptionHelper
.decryptData(invitation['countOfInvitDriver'])
?.toString() ??
'0') ??
0;
int countOfInvitDriver =
int.tryParse((invitation['countOfInvitDriver'])?.toString() ?? '0') ??
0;
double progressValue = (countOfInvitDriver / 10.0).clamp(0.0, 1.0);
return GestureDetector(
@@ -506,10 +503,9 @@ class InviteScreen extends StatelessWidget {
_buildStatItem(
context,
"Total Invites".tr,
encryptionHelper
.decryptData(controller.driverInvitationDataToPassengers[0]
['countOfInvitDriver'])
.toString(),
(controller.driverInvitationDataToPassengers[0]
['countOfInvitDriver']
.toString()),
),
_buildStatItem(
context,

View File

@@ -16,6 +16,7 @@ import '../../../constant/style.dart';
import '../../../controller/auth/apple_sigin.dart';
import '../../../controller/auth/captin/login_captin_controller.dart';
import '../../../controller/auth/google_sign.dart';
import '../../../controller/functions/encrypt_decrypt.dart';
import '../../../controller/functions/overlay_permisssion.dart';
import '../../../main.dart';
import '../../../print.dart';
@@ -324,10 +325,14 @@ class LoginCaptin extends StatelessWidget {
User? user = await authController
.signInWithApple();
if (user != null) {
box.write(
BoxName.emailDriver,
encryptionHelper.encryptData(
user.email.toString()));
box.write(
BoxName.driverID, user.uid);
box.write(BoxName.emailDriver,
user.email);
Get.find<LoginDriverController>()
.loginWithGoogleCredential(
box