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

View File

@@ -4,6 +4,7 @@ import 'package:sefer_driver/constant/box_name.dart';
import 'package:sefer_driver/controller/firebase/local_notification.dart';
import 'package:sefer_driver/controller/functions/crud.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';
@@ -95,107 +96,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 {
// final plainText =
// 'https://server.sefer.live/sefer.click/sefer';
// debugPrint('Plain Text: $plainText');
// Encrypt the data
// final encryptedData = encryptionHelper.encryptData(plainText);
// debugPrint('Encrypted: $encryptedData');
// Decrypt the data
// final decryptedData = encryptionHelper.decryptData(
// encryptedData); // Use the encryptedData variable
// debugPrint('Decrypted: $decryptedData');
// box.remove('DriversSecure');
var drivers0 = await CRUD().post(
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('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));
// }
}
},
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 {
// Get.to(SmsSignupEgypt());
// },
// icon: const Icon(
// FontAwesome5.grin_tears,
// size: 29,
// color: AppColor.blueColor,
// ),
// );
// }),
// ),
const SizedBox(
height: 5,

View File

@@ -301,12 +301,10 @@ class _OrderRequestPageState extends State<OrderRequestPage> {
'https://www.google.com/maps/dir/${controller.myList[0]}/${controller.myList[1]}/',
'DurationToPassenger':
controller.myList[15].toString(),
'rideId': encryptionHelper.decryptData(
controller.myList[16].toString()),
'passengerId': encryptionHelper.decryptData(
controller.myList[7].toString()),
'driverId': encryptionHelper.decryptData(
controller.myList[18].toString()),
'rideId': (controller.myList[16].toString()),
'passengerId':
(controller.myList[7].toString()),
'driverId': (controller.myList[18].toString()),
'durationOfRideValue':
controller.myList[19].toString(),
'paymentAmount':

View File

@@ -171,7 +171,7 @@ class CardSeferWalletDriver extends StatelessWidget {
children: [
Text(
// '${AppInformation.appName} Wallet',
'SEFER Wallet',
'SPEED Wallet',
style: AppStyle.headTitle.copyWith(
color: AppColor.writeColor, fontSize: 26),
),

View File

@@ -1,6 +1,7 @@
import 'package:sefer_driver/constant/box_name.dart';
import 'package:sefer_driver/constant/colors.dart';
import 'package:sefer_driver/constant/style.dart';
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
import 'package:sefer_driver/main.dart';
import 'package:sefer_driver/views/widgets/my_scafold.dart';
import 'package:sefer_driver/views/widgets/mycircular.dart';
@@ -73,7 +74,8 @@ class CaptainsCars extends StatelessWidget {
padding: const EdgeInsets.symmetric(
horizontal: 4),
child: Text(
car['car_plate'],
encryptionHelper.decryptData(
car['car_plate']),
style: AppStyle.title,
),
),

View File

@@ -73,31 +73,35 @@ class ProfileCaptain extends StatelessWidget {
driverId:
controller.captainProfileData['driverID'] ??
'',
name: controller
.captainProfileData['first_name'] +
name: encryptionHelper.decryptData((controller
.captainProfileData['first_name']) ??
'') +
' ' +
(controller.captainProfileData['last_name'] ??
encryptionHelper.decryptData((controller
.captainProfileData['last_name']) ??
''),
phoneNumber:
controller.captainProfileData['phone'] ?? '',
phoneNumber: encryptionHelper.decryptData(
controller.captainProfileData['phone']) ??
'',
email: encryptionHelper.decryptData(
controller.captainProfileData['email']) ??
'',
birthdate:
controller.captainProfileData['birthdate'] ??
'',
gender:
controller.captainProfileData['gender'] ?? '',
education:
controller.captainProfileData['education'] ??
'',
birthdate: encryptionHelper.decryptData(controller
.captainProfileData['birthdate']) ??
'',
gender: encryptionHelper.decryptData(controller
.captainProfileData['gender']) ??
'',
education: encryptionHelper.decryptData(controller
.captainProfileData['education']) ??
'',
carMake:
controller.captainProfileData['make'] ?? '',
carModel:
controller.captainProfileData['model'] ?? '',
carPlate:
controller.captainProfileData['car_plate'] ??
'',
carPlate: encryptionHelper.decryptData(controller
.captainProfileData['car_plate']) ??
'',
carColor:
controller.captainProfileData['color'] ?? '',
vin: controller.captainProfileData['vin'] ?? '',
@@ -107,8 +111,9 @@ class ProfileCaptain extends StatelessWidget {
expirationDate: controller
.captainProfileData['expiration_date'] ??
'',
ratingCount: int.parse(controller
.captainProfileData['ratingCount']) ??
ratingCount: int.tryParse(controller
.captainProfileData['ratingCount']
.toString()) ??
0,
ratingDriver: controller
.captainProfileData['ratingDriver'] !=
@@ -118,8 +123,9 @@ class ProfileCaptain extends StatelessWidget {
.toString()) ??
0
: null,
age: int.parse(
controller.captainProfileData['age']) ??
age: int.tryParse(controller
.captainProfileData['age']
.toString()) ??
0,
),
),