This commit is contained in:
Hamza-Ayed
2024-07-05 04:50:32 +03:00
parent b5bc36e4be
commit dc4677a6bf
21 changed files with 586 additions and 234 deletions

44
.env
View File

@@ -39,3 +39,47 @@ payMobOutClientSecrret='xyjjRlahJM0Xc38WjApCOh8bvgL9slFpNdM9YeCu9AhLqboKMPtmSvc2
payMobOutClient_id='Z05ut48dVkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl' payMobOutClient_id='Z05ut48dVkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl'
payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl' payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl' payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
#
#basicAuthCredentials= q9XDwNb2SWHU9nq0tIqWYIN+bvXt54jPVrBFOZUstsnk3Ndz2BOSI3wLC3GKMuqE
#basicCompareFaces= ZK2RkvTEAi0ihtR0GuJ+H2bmU1OVn5V/f9NLVoKZZdE=
#basicCompareFacesURL= ar0jvB0naim05FOurHErUfYAeinsHtAN899iUikg7tbJr+6xxOGCuKWOCHe5IvhNgCGRu0J93Kp81vuPDx4unmHE09ltyI+q6VxB/MS7qzc=
#accountSIDTwillo= Jg38nDPhemTsfLr6Lw/2FkBqXpgwsDREDKNZz4dFX8ZlhfR+c4SfLJw+5Kc9eCw9VIFDaAuONiCxy4EFZlTuDg==
#serverAPI= ylOIFlS8ojjZXo/KU+c9XfElPMf81wsrXfbJffd2vY8BIoAA+KPEgln5nhZm/NAChi96Fq/hxqX5OJM4oWFR0WhMwfMIP5kwdoHWtoJnaYDhyvLeEopljDHXxlMmavnzYmJPDJFO7RYC9bOZO/7ce9j5r9OApZFHCRE3xEiT11rvnc11nAS6FUND+DSqHixBpgRpaGzT6oI7V+/s/vY9UYyv1/87NDJCQcRdwqGNVxw=
#mapAPIKEY= tGW+KMGKtB6WNfuREjWHd1XT7O62xtleFECqMAAlugDro1IAeTZIulIQ3E8VZpWTdrY9VaxsP9HWpquGgn3FDw==
#twilloRecoveryCode= avovNMV1kWHcJCvEDCo2JB3YFuh7k7jFO/mQl9RPIf2dcqWYLgXlQJgYb1py7iMf
#authTokenTwillo= yX+P/HtnhF/zXqiR6dTmCNJkKqueZ/w6tRsj5shUtxmuvImHIFipy9Ncui4xDJ3qWYqpTJtK2E1s2MK0v4Ffng==
#chatGPTkey= eEFPdATgADNXrFigOePxRbJMcD+6WnO0p50QwNbTX42VarY2dSXKHZ7Vc0PlnSbvLTbYcmkeUKkOiZYh/t0gYP7heniFJ7CmGz50zvCbfAU=
#transactionCloude= fK6CI/ZhL5LrOdIm3l9JfStKlUYm1XcuFG/QYht8UeiNamZnRp4UsjUzs4+HNClOGsE5sGht3T6QMnE65e4lwwtBsXaDm+0Dlb6AcA6rMC8=
#visionApi= dXV9rtlwEBg7TrXCmPIc395+jpxaw/258dEBNfFUfbVQuJP+kWnFdzNzIyzFwjIGDAIgoE95uynR2/eNJOTY0A==
#chatGPTkeySefer= 2ZEe3pK2HOWRtEzTB7FjODCbB954UNnvb/L2x3lKsc9NCILNzgCffzcdqEzPs+lHCeolKViweygvgR7fIwC6z3cJJap7t+SPQ1noP5i2pRg=
#chatGPTkeySeferNew= KtZfNq+kEbVjU4eZVl+aexBKNybgr8jQvz/CZJQcH/CebLeFdkdfkJx43QA7UtH8oNH2hLTcrtqSKAXT0wYwShEG+Gt8pvgCx8xT+ViQrTE=
#secretKey= PNwYqtlLcDMlmKbzy3++wSPC/XB9WX2t+zfrJDsYz7LXD5jVFUGs3CXUF227VDGPe1sk10yMGLM4E818969GF7/qhZjLzwF8qXLAEpUhtGniQ+undfoiJw2vNfB4lXWKgQQC4N+/6KPb7zSZx8o8yVlvL/5iZiuf1LYhUhjJmJE=
#stripe_publishableKe= gyXxuOp+vaGcRTTBohZeTaK7HEhpNUVvWGcBNABhzHu125y6ftOwvf1Z8fYlfaG/ysClJpqfxBU8+RulI7KhtJM5mVrmALFiypv/6IlkACsundM6zkbxQGHzjfQdrfkdFZF00fpYjOI/3P/znZIlKGYYLmdxUqF3chAfYDet1/I=
#llamaKey= a3oCdxMeaKjatKyLQEnPMLqFmfLe9mCGRofsROVQ6NF7SCqxOt7h2A/KvdYWGBM42SxNTuWIq5+UsnPulqKbd3yVTRnG+Lx0rxPa+9mc48frICnl+hz6CSmJjOjDhHnE
#serverPHP= blf8gn/gV8/mvMZlPdJMnSu+ATBZfBThpVjNb9mzXT7OfBrBSZnCBxveUsCcXUW3
#cohere= SvRbfrRc+Gyyy20otHDz1cNNcQpoMyLm+TIkTyfZI7vnxkgsEYiGdYOJ0Punkz6JdY4qa3B0fu2OCZ7NOa6Y1w==
#claudeAiAPI= oO1ZcIFPBgin9gQs5vNT/oDs0KpJDVnjwXqKjCAABoezFxLUpAMINvSNruW7DFU2mbsjpJTDwpTzddsMCIPqi7AjzBpW6X1ddxYX+ZPuJ55Kymj5KvTHAwYYhW7F3l9sOjrtODWwhH6uGTNfh3Ftz531Xb2Qr5d3rKDC4H5tkFM=
#payPalClientId= VmMsEn1Kz4wCqCnWOm+XoUE2k2c7wA9y2cHqe303GSR9HfnuDqpbcijBYDs5EGYsYF/t68M1xlAp1OX+oXSN3RSsjKelJmbbreg8YtjTeErMVOSGHrsOHRY7hqlUYvmN8DUTlRTFvIdTX+RafY2LiA==
#payPalClientIdLive= qA7WnFU1WANkp1tFx/FsAQg11xw3MT9+29KiviNZ4/CJZ8HjXA1oaiXP9jFCdw9O5lIsxu77kwcHyyj7jazRo40gHt09LOiQx3B9TGyYU8xZKyrTgDYzaAN8uGtzh+im+O3uX9e8dB6hP3KjoEiWAw==
#payPalSecret= /X5bZua3pBhTWc+lM0Soj0B9DmZCAd7d6ptl7Odqvl6VM2WXsxLTEj+quzlqWsw5EMohotzv+vsgOaak7MnSFj/GiH3dsLrCDKRbKmMtO8B7y01sTxHM5KJBThdn00kdPhCrRupHGBQ2UVn7+Pvk+g==
#payPalSecretLive= IgD5ztFUiGNpKNn9tQ1BUrxJixFEa6qOD2rTlrMHWddgEFJfSnwguYk+ims2Fjh/Yyq6k7blq3rNw8QxvqYx8Zddn3JBkjJy+CuCO8PD87yE3Cq16lAYpKBUONx1L2JhfOvnpHmlKsItNp3VlO2hnA==
#geminiApi= bm0hPbzgZ4fYIiQIt+q01JMoinEwOanaTTP+w6VVa5ycvURUWzRNUGuxkw8SddBODHMsmw3m6QMDhWRV2JldWQ==
#geminiApiMasa= NivzPDHz8vLzsd+1NlCTdr7z0Q7QF20nXv64sc31KV5itWz+jy/wXfJKBk3FUkGws0ASOiO3bPcsS4ZpTDt/Gg==
#agoraAppId= VFN6+inSX0lGchoJJyyregcmoz7IRc4WFIvY0E7DSoSMOWy87h64PplAeR5gb0bdsSdBoNlKHVMqdiAiHf6rAA==
#agoraAppCertificate= K5mK/SbgSybbq1n8T8fwDjg+KTCBHaXFztmslJ6IVuEol+rAGhPN3i9zsvtQrHbKzhEQPvCL4Bga0UL9qAVZFA==
#usernamePayMob= RB5cSc0HLCKF47EJQgq+9aGwjc9M6aCBV/gC0h/f+gY=
#passwordPayMob= WDGpip/MF/k8K2bq+A6GYP40z9JrCkzMx5V6J+lzJ6Q=
#integrationIdPayMob= R1xVYlVQwYslnZ9J7XSgcguCuQSJalFSlBNnVP6mMbE=
#payMobApikey= g3vzSYRbIw9WOB+d48x5mt3CGMfGuuH8zFL6ane7b8mi8k2Jx571o3/3A93bAMj9cdW8yY0a1z1zgjqHoPNbBWhr5G4P5EySachi05ZQ5c25zXi/hO1RgNF9lA4+d5l4vpOqkNqglAD+t940Fg3Pa5UC5qhQNwsAz6OMFpRZoD87vdPRqX2ovzGnXy5OuljFuU0NO7tswQ7ECgZAROT5zGQQRksjbhjay3hrngENl6XUsdY8OczkBeKSkXD8T7RGKmsUDnn0C14N7ag8mCPponfs1+DvfG5jl5tYTCX07E4suvwbnx6rRrJXX8BrlC4u9f1ZPwjOJr1CVaWzxcOMLe4/FNhbqC93rBs1SB3zWYS8wjd+YD+Yzyhew2g0yodZ
#integrationIdPayMobWallet= dFjz/piJiilWVXHtZveA0wgU7d7evsQ9WhPsCTwFkT8=
#ocpApimSubscriptionKey= xg4WM1WHVuPBRV9W7xLC0TFRhjgnFuvXBIRddkWcIl7gJAoexceuFlHN7472eL9ZMs6xetYgAHkjsb95QBoF/g==
#smsPasswordEgypt= uvn2Wnr+Ze35cXGfznnb7Rjy+35y6ti38m4E5QA+6h8=
#chatGPTkeySeferNew4= /HJYg55+KIoHpEPH6yEULOm4lUs3fPsgPInSeq5z0PDmJOXqrkPMNKkr8BcmHeuvZE3OYWTiLkGlNThiMpTmXTgMFZtjTPLLRw/Ubcu/aCU=
#anthropicAIkeySeferNew= ELDX2kXW5wnEDEA7K+Wfhi6Tp98MyckswWQHpc2VqEh9XhethhxjemkyqqQ8U2QiTbI00MjlM+BGz0/Y0o1y/LTkzrPwLCaxxxi9m5F58vDukDoeRvFykeNVC1rXiwj5Ew7GU1z1SX05mQ8Iz7s9dv094Ix8qfv9I5GZs8oh14k=
#llama3Key= tK+3v5cmkZ5X9mTyrEl+GscVweQKXm12c6fEUCJJ1hfd0oODKViaQr47Ta06eBrSBVy5KcXmjpHMKAAJl/AT9hofexIqQx4mwBs2pzaGEII=
#payMobOutClientSecrret= Y4QJnSAUYwWYPOcpfUI57vXFrn6uSc0sAk1IPkEVxjcoKGhyHZmtQW9yzgTWzpwkX6SxPtryC5tN7lP5CatIAytRqN/l00SGJpz1k4JezuW6o8UiGTvrVXxkObxQup2elF5hobG1/HgQ96pyR1447GtlcJ74rGeDqQXbC+utvpFsoLHYpB42MFCRtapUx5/4SBuJNWjmK0Wbj3gnx3GoPQ==
#payMobOutClient_id= rtUDCUWMAntRHxcDwmuvE62z7ZCy/AUsfYmotuhHKjG+4Q5woRNIvtm4jwRG0IYUYX2e8xEbDDfnGr4B5AT9pQ==
#payMobOutPassword= EnF8QHZxcAzLxi/OSjl8G9hUof0taNLgiKWAB8ElY7ZSWzrBUcpiO71+oD9hAjHL
#payMobOutUserName= PP3va1/KdbA42xHGN+qkN4J90E3icYbHVhgKX/nKoMEwhjwjB7W2ehy+bfN+ggj1

View File

@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 33 targetSdkVersion 33
versionCode 47 versionCode 48
versionName '1.5.47' versionName '1.5.48'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml'] // manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
} }

View File

@@ -69,3 +69,74 @@ class AK {
static final String payMobOutUserName = static final String payMobOutUserName =
a.r(a.r(a.r(Env.payMobOutUserName, cn), cC), cs); a.r(a.r(a.r(Env.payMobOutUserName, cn), cC), cs);
} }
//
// import '../controller/functions/encrypt.dart';
// import '../env/env.dart';
// import 'char_map.dart';
// import 'credential.dart';
//
// class AK {
// static final AC a = AC();
// static final String publishableKey =
// KeyEncryption.decryptKey(Env.stripePublishableKe);
// static final String secretKey = KeyEncryption.decryptKey(Env.secretKey);
// static final String basicAuthCredentials =
// KeyEncryption.decryptKey(Env.basicAuthCredentials);
// static final String accountSIDTwillo =
// KeyEncryption.decryptKey(Env.accountSIDTwillo);
// static final String serverAPI = KeyEncryption.decryptKey(Env.serverAPI);
// static final String mapAPIKEY = KeyEncryption.decryptKey(Env.mapAPIKEY);
// static final String twilloRecoveryCode =
// KeyEncryption.decryptKey(Env.twilloRecoveryCode);
// static final String authTokenTwillo =
// KeyEncryption.decryptKey(Env.authTokenTwillo);
// static final String chatGPTkey = KeyEncryption.decryptKey(Env.chatGPTkey);
// static final String transactionCloude =
// KeyEncryption.decryptKey(Env.transactionCloude);
// static final String visionApi = KeyEncryption.decryptKey(Env.visionApi);
// static final String chatGPTkeySefer =
// KeyEncryption.decryptKey(Env.chatGPTkeySefer);
// static final String chatGPTkeySeferNew =
// KeyEncryption.decryptKey(Env.chatGPTkeySeferNew);
// static final String serverPHP = Env.serverPHP;
// static final String llamaKey = KeyEncryption.decryptKey(Env.llamaKey);
// static final String cohere = KeyEncryption.decryptKey(Env.cohere);
// static final String claudeAiAPI = KeyEncryption.decryptKey(Env.claudeAiAPI);
// static final String payPalClientId =
// KeyEncryption.decryptKey(Env.payPalClientId);
// static final String payPalSecret = KeyEncryption.decryptKey(Env.payPalSecret);
// static final String geminiApi = KeyEncryption.decryptKey(Env.geminiApi);
// static final String agoraAppId = KeyEncryption.decryptKey(Env.agoraAppId);
// static final String agoraAppCertificate =
// KeyEncryption.decryptKey(Env.agoraAppCertificate);
// static final String payPalClientIdLive =
// KeyEncryption.decryptKey(Env.payPalClientIdLive);
// static final String payPalSecretLive =
// KeyEncryption.decryptKey(Env.payPalSecretLive);
// static final String integrationIdPayMob =
// KeyEncryption.decryptKey(Env.integrationIdPayMob);
// static final String passwordPayMob =
// KeyEncryption.decryptKey(Env.passwordPayMob);
// static final String usernamePayMob =
// KeyEncryption.decryptKey(Env.usernamePayMob);
// static final String payMobApikey = KeyEncryption.decryptKey(Env.payMobApikey);
// static final String integrationIdPayMobWallet =
// KeyEncryption.decryptKey(Env.integrationIdPayMobWallet);
// static final String smsPasswordEgypt =
// KeyEncryption.decryptKey(Env.smsPasswordEgypt);
// static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
// static final String chatGPTkeySeferNew4 =
// KeyEncryption.decryptKey(Env.chatGPTkeySeferNew4);
// static final String anthropicAIkeySeferNew =
// KeyEncryption.decryptKey(Env.anthropicAIkeySeferNew);
// static final String llama3Key = KeyEncryption.decryptKey(Env.llama3Key);
// static final String payMobOutClientSecrret =
// KeyEncryption.decryptKey(Env.payMobOutClientSecrret);
// static final String payMobOutClient_id =
// KeyEncryption.decryptKey(Env.payMobOutClient_id);
// static final String payMobOutPassword =
// KeyEncryption.decryptKey(Env.payMobOutPassword);
// static final String payMobOutUserName =
// KeyEncryption.decryptKey(Env.payMobOutUserName);
// }

View File

@@ -58,6 +58,8 @@ class AppLink {
static String getRideStatusFromStartApp = static String getRideStatusFromStartApp =
"$ride/rides/getRideStatusFromStartApp.php"; "$ride/rides/getRideStatusFromStartApp.php";
static String updateRides = "$ride/rides/update.php"; static String updateRides = "$ride/rides/update.php";
static String updateRideAndCheckIfApplied =
"$ride/rides/updateRideAndCheckIfApplied.php";
static String updateStausFromSpeed = "$ride/rides/updateStausFromSpeed.php"; static String updateStausFromSpeed = "$ride/rides/updateStausFromSpeed.php";
static String deleteRides = "$ride/rides/delete.php"; static String deleteRides = "$ride/rides/delete.php";

View File

@@ -57,9 +57,10 @@ class LoginDriverController extends GetxController {
'email': email, 'email': email,
'id': driverID, 'id': driverID,
}); });
print(res);
if (res == 'Failure') { if (res == 'Failure') {
//Failure //Failure
if (box.read(BoxName.phoneVerified) == '1') { if (box.read(BoxName.phoneVerified).toString() == '1') {
Get.offAll(() => EgyptCardAI()); Get.offAll(() => EgyptCardAI());
} else { } else {
Get.offAll(() => SmsSignupEgypt()); Get.offAll(() => SmsSignupEgypt());
@@ -72,7 +73,7 @@ class LoginDriverController extends GetxController {
var jsonDecoeded = jsonDecode(res); var jsonDecoeded = jsonDecode(res);
if (jsonDecoeded.isNotEmpty) { if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success' && if (jsonDecoeded['status'] == 'success' &&
jsonDecoeded['data'][0]['is_verified'] == 1) { jsonDecoeded['data'][0]['is_verified'].toString() == '1') {
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']); box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
box.write(BoxName.gender, jsonDecoeded['data'][0]['gender']); box.write(BoxName.gender, jsonDecoeded['data'][0]['gender']);
box.write(BoxName.phoneVerified, box.write(BoxName.phoneVerified,

View File

@@ -109,13 +109,17 @@ class RegisterCaptainController extends GetxController {
if (res != 'failure') { if (res != 'failure') {
// var dec = jsonDecode(res); // var dec = jsonDecode(res);
box.write(BoxName.phoneDriver, '+2${phoneController.text}'); box.write(BoxName.phoneDriver, '+2${phoneController.text}');
box.write(BoxName.phoneVerified, 1); box.write(BoxName.phoneVerified, '1');
// var res1 = await CRUD().post( // var res1 = await CRUD().post(
// link: AppLink.updateAccountBank, // link: AppLink.updateAccountBank,
// payload: {'phone': '+2${phoneController.text}'}); // payload: {'phone': '+2${phoneController.text}'});
// if (res1 != 'failure') { // if (res1 != 'failure') {
Get.to(EgyptCardAI()); await Get.put(LoginDriverController()).loginUsingCredentials(
box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver).toString(),
);
// Get.to(EgyptCardAI());
// } else { // } else {
// Get.snackbar('title', 'message'); // Get.snackbar('title', 'message');
// } // }

View File

@@ -98,7 +98,10 @@ class GoogleSignInHelper {
box.write(BoxName.emailDriver, user.email); box.write(BoxName.emailDriver, user.email);
// box.write(BoxName.nameDriver, user.displayName); // box.write(BoxName.nameDriver, user.displayName);
// box.write(BoxName.driverPhotoUrl, user.photoUrl); // box.write(BoxName.driverPhotoUrl, user.photoUrl);
print(box.read(BoxName.driverID).toString());
print(
box.read(BoxName.emailDriver).toString(),
);
// Perform any additional sign-up tasks or API calls here // Perform any additional sign-up tasks or API calls here
// For example, you can send the user data to your server for registration // For example, you can send the user data to your server for registration
} }

View File

@@ -109,22 +109,22 @@ class FirebaseMessagesController extends GetxController {
// 'PolylineJson': myPoints, // 'PolylineJson': myPoints,
'body': message.notification!.body 'body': message.notification!.body
}); });
} else if (message.notification!.title == 'Cancel Trip'.tr) { } else if (message.notification!.title == 'Cancel Trip') {
NotificationController().showNotification( NotificationController().showNotification(
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel'); 'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel');
cancelTripDialog(); cancelTripDialog();
} else if (message.notification!.title! == 'token change'.tr) { } else if (message.notification!.title! == 'token change') {
// NotificationController() // NotificationController()
// .showNotification('token change'.tr, 'token change', 'cancel'); // .showNotification('token change'.tr, 'token change', 'cancel');
// GoogleSignInHelper.signOut(); // GoogleSignInHelper.signOut();
GoogleSignInHelper.signOut(); GoogleSignInHelper.signOut();
} else if (message.notification!.title! == 'message From passenger'.tr) { } else if (message.notification!.title! == 'message From passenger') {
NotificationController() NotificationController()
.showNotification('message From passenger'.tr, ''.tr, 'tone2'); .showNotification('message From passenger', ''.tr, 'tone2');
passengerDialog(message.notification!.body!); passengerDialog(message.notification!.body!);
update(); update();
} else if (message.notification!.title! == 'Hi ,I will go now'.tr) { } else if (message.notification!.title! == 'Hi ,I will go now') {
// Get.snackbar('Hi ,I will go now', '', // Get.snackbar('Hi ,I will go now', '',
// backgroundColor: AppColor.greenColor); // backgroundColor: AppColor.greenColor);
NotificationController().showNotification( NotificationController().showNotification(

View File

@@ -27,6 +27,9 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}', 'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
}, },
); );
print(response.request);
print(response.body);
print(response.statusCode);
// if (response.statusCode == 200) { // if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {

View File

@@ -0,0 +1,83 @@
import 'package:encrypt/encrypt.dart' as encrypt;
import 'dart:convert';
import 'package:http/http.dart' as http;
//
import 'dart:convert';
import 'dart:math';
import 'package:encrypt/encrypt.dart' as encrypt;
class KeyEncryption {
static final _key = encrypt.Key.fromUtf8('mehmetDEV@2101'); // ضع مفتاحك هنا
static String encryptKey(String key) {
final iv = encrypt.IV.fromLength(16); // توليد تهيئة عشوائية
final encrypter =
encrypt.Encrypter(encrypt.AES(_key, mode: encrypt.AESMode.cbc));
final encrypted = encrypter.encrypt(key, iv: iv);
final result = iv.bytes + encrypted.bytes; // تضمين التهيئة مع النص المشفر
return base64Encode(result);
}
static String decryptKey(String encryptedKey) {
final decoded = base64Decode(encryptedKey);
final iv = encrypt.IV(decoded.sublist(0, 16)); // استخراج التهيئة
final encrypted =
encrypt.Encrypted(decoded.sublist(16)); // استخراج النص المشفر
final encrypter =
encrypt.Encrypter(encrypt.AES(_key, mode: encrypt.AESMode.cbc));
return encrypter.decrypt(encrypted, iv: iv);
}
}
// class KeyEncryption {
// static final _key = encrypt.Key.fromUtf8('7'); // ضع مفتاحك هنا
//
// static String encryptKey(String key) {
// final iv = encrypt.IV.fromLength(16); // توليد تهيئة عشوائية
// final encrypter =
// encrypt.Encrypter(encrypt.AES(_key, mode: encrypt.AESMode.cbc));
// final encrypted = encrypter.encrypt(key, iv: iv);
// final result = iv.bytes + encrypted.bytes; // تضمين التهيئة مع النص المشفر
// return base64Encode(result);
// }
//
// static String decryptKey(String encryptedKey) {
// final decoded = base64Decode(encryptedKey);
// final iv = encrypt.IV(decoded.sublist(0, 16)); // استخراج التهيئة
// final encrypted =
// encrypt.Encrypted(decoded.sublist(16)); // استخراج النص المشفر
// final encrypter =
// encrypt.Encrypter(encrypt.AES(_key, mode: encrypt.AESMode.cbc));
// return encrypter.decrypt(encrypted, iv: iv);
// }
// }
// class KeyEncryption {
// static final _key =
// encrypt.Key.fromUtf8('32-character-key....'); // ضع مفتاحك هنا
//
// static String encryptKey(String key) {
// final iv = encrypt.IV.fromLength(16); // توليد تهيئة عشوائية
// final encrypter =
// encrypt.Encrypter(encrypt.AES(_key, mode: encrypt.AESMode.cbc));
// final encrypted = encrypter.encrypt(key, iv: iv);
// final result = iv.bytes + encrypted.bytes; // تضمين التهيئة مع النص المشفر
// return base64Encode(result);
// }
//
// static Future<void> storeApiKeys(List<String> apiKeys) async {
// final encryptedKeys = apiKeys.map((key) => encryptKey(key)).toList();
// final response = await http.post(
// Uri.parse('https://yourdomain.com/store_keys.php'),
// body: jsonEncode({'keys': encryptedKeys}),
// headers: {'Content-Type': 'application/json'},
// );
//
// if (response.statusCode == 200) {
// print('Keys stored successfully.');
// } else {
// print('Failed to store keys.');
// }
// }
// }

View File

@@ -201,7 +201,7 @@ class AI extends GetxController {
if (isCarSaved && isDriverSaved) { if (isCarSaved && isDriverSaved) {
DeviceController().getDeviceSerialNumber(); DeviceController().getDeviceSerialNumber();
box.write(BoxName.phoneVerified, 1); box.write(BoxName.phoneVerified, '1');
Get.offAll(() => HomeCaptain()); Get.offAll(() => HomeCaptain());
// Get.offAll(() => HomeCaptain()); // Get.offAll(() => HomeCaptain());
} }
@@ -209,89 +209,164 @@ class AI extends GetxController {
} }
Future<void> addDriverEgypt() async { Future<void> addDriverEgypt() async {
try { isLoading = true;
// Extract values from box or set defaults update();
var firstName = responseIdEgyptDriverLicense['firstName'] ?? '';
var lastName = responseIdEgyptDriverLicense['lastName'] ?? '';
var email = box.read(BoxName.emailDriver) ?? '';
var phone = box.read(BoxName.phoneDriver)?.toString() ?? '';
var driverId = box.read(BoxName.driverID)?.toString() ?? '';
var password = '123456';
var gender = responseIdEgyptBack['gender'] == 'ذكر' ? 'Male' : 'Female';
var licenseType = responseIdEgyptDriverLicense['license_type'] ?? '';
var nationalNumber = responseIdEgyptBack['nationalID'] ?? '';
var nameArabic = responseIdEgyptDriverLicense['name_arabic'] ?? '';
var nameEnglish = responseIdEgyptDriverLicense['name_english'] ?? '';
var issueDate = responseIdEgyptDriverLicense['issue_date'] ?? '';
var expiryDate = responseIdEgyptDriverLicense['expiry_date'] ?? '';
var licenseCategories =
responseIdEgyptDriverLicense['license_categories'] ?? '';
var address = responseIdEgyptFront['address'] ?? '';
var cardId = responseIdEgyptFront['card_id'] ?? '';
var occupation = responseIdEgyptBack['occupation'] ?? '';
var education = responseIdEgyptBack['occupation'] ?? '';
var licenseIssueDate =
responseIdEgyptDriverLicense['issue_date'].toString() ?? '';
var religion = responseIdEgyptBack['religion'] ?? '';
var status = responseIdEgyptBack['fullName'] ?? '';
var birthdate = responseIdEgyptFront['dob'] != null
? DateTime.parse(responseIdEgyptFront['dob'] + '-01-01').toString()
: '1960-01-01';
var maritalStatus = responseIdEgyptBack['maritalStatus'] ?? ''; var payload = {
var site = responseIdEgyptDriverLicense['address'] ?? ''; 'first_name': responseIdEgyptDriverLicense['firstName']?.toString() ??
var employmentType = responseIdEgyptDriverLicense['employmentType'] ?? ''; 'Not specified',
'last_name': responseIdEgyptDriverLicense['lastName']?.toString() ??
// Create payload 'Not specified',
var payload = { 'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
'first_name': firstName, 'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
'last_name': lastName, 'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
'email': email, 'password': '123456',
'phone': phone, 'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified',
'id': driverId, 'license_type':
'password': password, responseIdEgyptDriverLicense['license_type']?.toString() ??
'gender': gender, 'Not specified',
'license_type': licenseType, 'national_number':
'national_number': nationalNumber, responseIdEgyptBack['nationalID']?.toString() ?? 'Not specified',
'name_arabic': nameArabic, 'name_arabic': responseIdEgyptDriverLicense['name_arabic']?.toString() ??
'name_english': nameEnglish, 'Not specified',
'issue_date': issueDate, 'name_english':
'expiry_date': expiryDate, responseIdEgyptDriverLicense['name_english']?.toString() ??
'license_categories': licenseCategories, 'Not specified',
'address': address, 'issue_date': responseIdEgyptDriverLicense['issue_date']?.toString() ??
'card_id': cardId, 'Not specified',
'occupation': occupation, 'expiry_date': responseIdEgyptDriverLicense['expiry_date']?.toString() ??
'education': education, 'Not specified',
'licenseIssueDate': licenseIssueDate, 'license_categories': responseIdEgyptDriverLicense['license_categories']
'religion': religion, is List
'status': status, ? responseIdEgyptDriverLicense['license_categories'].join(', ')
'birthdate': birthdate, : responseIdEgyptDriverLicense['license_categories']?.toString() ??
'maritalStatus': maritalStatus, 'Not specified',
'site': site, 'address': responseIdEgyptFront['address']?.toString() ?? 'Not specified',
'employmentType': employmentType, 'card_id': responseIdEgyptFront['card_id']?.toString() ?? 'Not specified',
}; 'occupation':
isLoading = true; responseIdEgyptBack['occupation']?.toString() ?? 'Not specified',
update(); 'education':
// Make POST request responseIdEgyptBack['occupation']?.toString() ?? 'Not specified',
var res = await CRUD().post(link: AppLink.signUpCaptin, payload: payload); 'licenseIssueDate':
var status1 = jsonDecode(res); responseIdEgyptDriverLicense['issue_date']?.toString() ??
isLoading = false; 'Not specified',
update(); 'religion':
// Handle response responseIdEgyptBack['religion']?.toString() ?? 'Not specified',
'status': 'yet',
if (status1['status'] == 'success') { 'birthdate': responseIdEgyptFront['dob']?.toString() ?? 'Not specified',
isDriverSaved = true; 'maritalStatus':
Get.snackbar('Success', 'Driver data saved successfully', responseIdEgyptBack['maritalStatus']?.toString() ?? 'Not specified',
backgroundColor: AppColor.greenColor); 'site': responseIdEgyptDriverLicense['address']?.toString() ??
} else { 'Not specified',
Get.snackbar('Error', 'Failed to save driver data', 'employmentType':
backgroundColor: Colors.red); responseIdEgyptDriverLicense['employmentType']?.toString() ??
} 'Not specified',
} catch (e) { };
Get.snackbar('Error', 'An error occurred while saving driver data', var res = await CRUD().post(link: AppLink.signUpCaptin, payload: payload);
var status1 = jsonDecode(res);
isLoading = false;
update();
print(res);
// Handle response
if (status1['status'] == 'success') {
isDriverSaved = true;
Get.snackbar('Success', 'Driver data saved successfully',
backgroundColor: AppColor.greenColor);
} else {
Get.snackbar('Error', 'Failed to save driver data',
backgroundColor: Colors.red); backgroundColor: Colors.red);
} }
// } catch (e) {
// isLoading = false;
// update();
// Get.snackbar('Error', 'An error occurred while saving driver data: $e',
// backgroundColor: Colors.red);
// }
} }
// Future<void> addDriverEgypt() async {
// // try {
// // Extract values from box or set defaults
// var firstName = responseIdEgyptDriverLicense['firstName'] ?? '';
// var lastName = responseIdEgyptDriverLicense['lastName'] ?? '';
// var email = box.read(BoxName.emailDriver) ?? '';
// var phone = box.read(BoxName.phoneDriver)?.toString() ?? '';
// var driverId = box.read(BoxName.driverID)?.toString() ?? '';
// var password = '123456';
// var gender = responseIdEgyptBack['gender'] == 'ذكر' ? 'Male' : 'Female';
// var licenseType = responseIdEgyptDriverLicense['license_type'] ?? '';
// var nationalNumber = responseIdEgyptBack['nationalID'] ?? '';
// var nameArabic = responseIdEgyptDriverLicense['name_arabic'] ?? '';
// var nameEnglish = responseIdEgyptDriverLicense['name_english'] ?? '';
// var issueDate = responseIdEgyptDriverLicense['issue_date'] ?? '';
// var expiryDate = responseIdEgyptDriverLicense['expiry_date'] ?? '';
// var licenseCategories =
// responseIdEgyptDriverLicense['license_categories'] ?? '';
// var address = responseIdEgyptFront['address'] ?? '';
// var cardId = responseIdEgyptFront['card_id'] ?? '';
// var occupation = responseIdEgyptBack['occupation'] ?? '';
// var education = responseIdEgyptBack['occupation'] ?? '';
// var licenseIssueDate =
// responseIdEgyptDriverLicense['issue_date'].toString() ?? '';
// var religion = responseIdEgyptBack['religion'] ?? '';
// var status = responseIdEgyptBack['fullName'] ?? '';
// var birthdate = responseIdEgyptFront['dob'] != null
// ? DateTime.parse(responseIdEgyptFront['dob'] + '-01-01').toString()
// : '1960-01-01';
//
// var maritalStatus = responseIdEgyptBack['maritalStatus'] ?? '';
// var site = responseIdEgyptDriverLicense['address'] ?? '';
// var employmentType = responseIdEgyptDriverLicense['employmentType'] ?? '';
//
// // Create payload
// var payload = {
// 'first_name': firstName,
// 'last_name': lastName,
// 'email': email,
// 'phone': phone,
// 'id': driverId,
// 'password': password,
// 'gender': gender,
// 'license_type': licenseType,
// 'national_number': nationalNumber,
// 'name_arabic': nameArabic,
// 'name_english': nameEnglish,
// 'issue_date': issueDate,
// 'expiry_date': expiryDate,
// 'license_categories': licenseCategories,
// 'address': address,
// 'card_id': cardId,
// 'occupation': occupation,
// 'education': education,
// 'licenseIssueDate': licenseIssueDate,
// 'religion': religion,
// 'status': status,
// 'birthdate': birthdate,
// 'maritalStatus': maritalStatus,
// 'site': site,
// 'employmentType': employmentType,
// };
// isLoading = true;
// update();
// // Make POST request
// var res = await CRUD().post(link: AppLink.signUpCaptin, payload: payload);
// var status1 = jsonDecode(res);
// isLoading = false;
// update();
// // Handle response
//
// if (status1['status'] == 'success') {
// isDriverSaved = true;
// Get.snackbar('Success', 'Driver data saved successfully',
// backgroundColor: AppColor.greenColor);
// } else {
// Get.snackbar('Error', 'Failed to save driver data',
// backgroundColor: Colors.red);
// }
// // } catch (e) {
// // Get.snackbar('Error', 'An error occurred while saving driver data',
// // backgroundColor: Colors.red);
// // }
// }
Future addRegistrationCarEgypt() async { Future addRegistrationCarEgypt() async {
try { try {

View File

@@ -4,6 +4,7 @@ import 'package:SEFER/constant/links.dart';
import 'package:SEFER/constant/style.dart'; import 'package:SEFER/constant/style.dart';
import 'package:SEFER/main.dart'; import 'package:SEFER/main.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart'; import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/box_name.dart'; import '../../../constant/box_name.dart';
import '../../../constant/table_names.dart'; import '../../../constant/table_names.dart';
@@ -21,6 +22,8 @@ class OrderRequestController extends GetxController {
String countRefuse = '0'; String countRefuse = '0';
bool applied = false; bool applied = false;
final locationController = Get.put(LocationController()); final locationController = Get.put(LocationController());
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
@override @override
void onInit() { void onInit() {
@@ -30,6 +33,30 @@ class OrderRequestController extends GetxController {
super.onInit(); super.onInit();
} }
void addCustomStartIcon() async {
// Create the marker with the resized image
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png',
mipmaps: false)
.then((value) {
startIcon = value;
update();
});
}
void addCustomEndIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/b.png',
mipmaps: false)
.then((value) {
endIcon = value;
update();
});
}
void changeApplied() { void changeApplied() {
applied = true; applied = true;
update(); update();

View File

@@ -4,8 +4,21 @@ class MyTranslation extends Translations {
@override @override
Map<String, Map<String, String>> get keys => { Map<String, Map<String, String>> get keys => {
"ar": { "ar": {
"We use location to get accurate and nearest passengers for you":
"نستخدم الموقع للحصول على أقرب الركاب وأكثرهم دقة لك",
"This ride is already applied by another driver.":
"هذه الرحلة قام بقبولها سائق آخر بالفعل.",
"Please don't be late"
"My location is correct. You can search for me using the navigation app":
"موقعي صحيح. يمكنك البحث عني باستخدام تطبيق الملاحة",
"Hello, I'm at the agreed-upon location":
"مرحباً، أنا في المكان المتفق عليه",
"message From Driver": "رسالة من السائق",
"How much longer will you be?": "‏قدامك قد إيه",
'Phone number is verified before': "تم التحقق من رقم الهاتف مسبقاً",
'Change Ride': 'تغيير الرحلة',
'Cost Of Trip IS ': "تكلفة الرحلة هي", 'Cost Of Trip IS ': "تكلفة الرحلة هي",
'message From passenger': "رسالة من الراكب",
"Where are you, sir?": "أنا وصلت حضرتك فين.", "Where are you, sir?": "أنا وصلت حضرتك فين.",
"I've been trying to reach you but your phone is off.": "I've been trying to reach you but your phone is off.":
"بحاول أكلمك التلفون مغلق.", "بحاول أكلمك التلفون مغلق.",
@@ -419,7 +432,7 @@ class MyTranslation extends Translations {
"To change some Settings": "لتغيير بعض الإعدادات", "To change some Settings": "لتغيير بعض الإعدادات",
"To change Language the App": "لتغيير لغة التطبيق", "To change Language the App": "لتغيير لغة التطبيق",
"Order Request Page": "صفحة طلب الطلبية", "Order Request Page": "صفحة طلب الطلبية",
"Rouats of Trip": "روات تريب", "Routs of Trip": "طرق الرحلة",
"Passenger Name is": "اسم المسافر", "Passenger Name is": "اسم المسافر",
"Total From Passenger is": "إجمالي من الراكب هو", "Total From Passenger is": "إجمالي من الراكب هو",
"Duration To Passenger is": "المدة إلى الراكب", "Duration To Passenger is": "المدة إلى الراكب",
@@ -718,7 +731,8 @@ class MyTranslation extends Translations {
"لا توجد بطاقة SIM، لا توجد مشكلة! اتصل بالشريك السائق مباشرة من خلال تطبيقنا. نحن نستخدم التكنولوجيا المتقدمة لضمان خصوصيتك.", "لا توجد بطاقة SIM، لا توجد مشكلة! اتصل بالشريك السائق مباشرة من خلال تطبيقنا. نحن نستخدم التكنولوجيا المتقدمة لضمان خصوصيتك.",
"This ride type allows changes, but the price may increase": "This ride type allows changes, but the price may increase":
"يسمح نوع الرحلة هذا بالتغييرات، لكن قد يرتفع السعر", "يسمح نوع الرحلة هذا بالتغييرات، لكن قد يرتفع السعر",
"message From passenger": "رسالة من الراكب", 'message From Driver': 'رسالة من السائق',
'message From passenger': "رسالة من الراكب",
"Select one message": "اختر رسالة واحدة", "Select one message": "اختر رسالة واحدة",
"My location is correct. You can search for me using the navigation app": "My location is correct. You can search for me using the navigation app":
"موقعي صحيح. يمكنك البحث عني باستخدام تطبيق الملاحة", "موقعي صحيح. يمكنك البحث عني باستخدام تطبيق الملاحة",

View File

@@ -73,7 +73,7 @@ class RateController extends GetxController {
} else { } else {
double pointsSubtraction = 0; double pointsSubtraction = 0;
pointsSubtraction = remainingFee * pointsSubtraction = remainingFee *
(-1) * (-1) /
double.parse( double.parse(
Get.find<MapDriverController>().kazan); // for egypt /100 Get.find<MapDriverController>().kazan); // for egypt /100
var paymentToken4 = await Get.find<MapDriverController>() var paymentToken4 = await Get.find<MapDriverController>()
@@ -88,7 +88,7 @@ class RateController extends GetxController {
}); });
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'Wallet Added'.tr, 'Wallet Added'.tr,
'Wallet Added${(pointsSubtraction).toStringAsFixed(0)}'.tr, 'Wallet Added${(remainingFee).toStringAsFixed(0)}'.tr,
Get.find<MapDriverController>().tokenPassenger, Get.find<MapDriverController>().tokenPassenger,
'tone2.wav'); 'tone2.wav');
walletChecked = 'true'; walletChecked = 'true';

View File

@@ -80,7 +80,7 @@ class EgyptCardAI extends StatelessWidget {
egyptCarLicenceBack(), egyptCarLicenceBack(),
egyptDriverIDFront(), egyptDriverIDFront(),
egyptDriverIDBack(), egyptDriverIDBack(),
egyptCriminalRecord(), // egyptCriminalRecord(),
], ],
), ),
), ),

View File

@@ -10,6 +10,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../../../constant/char_map.dart'; import '../../../../../constant/char_map.dart';
import '../../../../../constant/colors.dart'; import '../../../../../constant/colors.dart';
import '../../../../../constant/credential.dart'; import '../../../../../constant/credential.dart';
import '../../../../../controller/functions/encrypt.dart';
import '../../../../../controller/functions/launch.dart'; import '../../../../../controller/functions/launch.dart';
import '../../../../Rate/ride_calculate_driver.dart'; import '../../../../Rate/ride_calculate_driver.dart';
import '../../../../../controller/functions/location_controller.dart'; import '../../../../../controller/functions/location_controller.dart';
@@ -30,19 +31,34 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
// borderRadius: BorderRadius.circular(15)), // borderRadius: BorderRadius.circular(15)),
// child: IconButton( // child: IconButton(
// onPressed: () { // onPressed: () {
// AC credentials = AC(); // // AC credentials = AC();
// String apiKey = '4601103'; // String apiKey = 'mehmetDEV@2101';
// String convertedStringN = credentials.c( // // String convertedStringN = credentials.c(
// credentials.c(credentials.c(apiKey, cs), cC), cn); // // credentials.c(credentials.c(apiKey, cs), cC), cn);
// print(convertedStringN); // // print(convertedStringN);
// String retrievedStringS = credentials.r( // // String retrievedStringS = credentials.r(
// credentials.r(credentials.r(convertedStringN, cn), cC), // // credentials.r(credentials.r(convertedStringN, cn), cC),
// cs); // // cs);
// print(retrievedStringS); // // print(retrievedStringS);
// // // // //
// if (retrievedStringS == apiKey) { // // if (retrievedStringS == apiKey) {
// print('same'); // // print('same');
// } // // }
//
// // key.forEach((key, apiKey) {
// String encryptedApiKey = KeyEncryption.encryptKey(apiKey);
// print('Encrypted = $encryptedApiKey');
//
// String decryptedApiKey =
// KeyEncryption.decryptKey(encryptedApiKey);
// print('Decrypted : $decryptedApiKey');
//
// // if (decryptedApiKey == apiKey) {
// // print('Keys match for $decryptedApiKey');
// // } else {
// // // print('Keys do not match for $key');
// // }
// // });
// }, // },
// icon: const Icon( // icon: const Icon(
// FontAwesome.map_signs, // FontAwesome.map_signs,

View File

@@ -92,6 +92,7 @@ class PassengerInfoWindow extends StatelessWidget {
AppStyle.title, AppStyle.title,
content: SizedBox( content: SizedBox(
height: Get.height * .5, height: Get.height * .5,
width: Get.width * .6,
child: ListView( child: ListView(
// mainAxisAlignment: // mainAxisAlignment:
// MainAxisAlignment // MainAxisAlignment
@@ -100,8 +101,7 @@ class PassengerInfoWindow extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'message From Driver' 'message From Driver',
.tr,
"Where are you, sir?" "Where are you, sir?"
.tr, .tr,
controller controller
@@ -132,8 +132,7 @@ class PassengerInfoWindow extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'message From Driver' 'message From Driver',
.tr,
"I've been trying to reach you but your phone is off." "I've been trying to reach you but your phone is off."
.tr, .tr,
controller controller
@@ -164,8 +163,7 @@ class PassengerInfoWindow extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'message From Driver' 'message From Driver',
.tr,
"Please don't be late, I'm waiting for you at the specified location." "Please don't be late, I'm waiting for you at the specified location."
.tr, .tr,
controller controller
@@ -196,8 +194,7 @@ class PassengerInfoWindow extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'message From Driver' 'message From Driver',
.tr,
"Please don't be late" "Please don't be late"
.tr, .tr,
controller controller
@@ -226,7 +223,8 @@ class PassengerInfoWindow extends StatelessWidget {
height: 5, height: 5,
), ),
SizedBox( SizedBox(
width: 335, width: Get.width *
.5,
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
@@ -237,8 +235,8 @@ class PassengerInfoWindow extends StatelessWidget {
.formKey2, .formKey2,
child: child:
SizedBox( SizedBox(
width: width: Get.width *
300, .4,
child: MyTextForm( child: MyTextForm(
controller: controller:
controller.messageToPassenger, controller.messageToPassenger,
@@ -250,7 +248,7 @@ class PassengerInfoWindow extends StatelessWidget {
onPressed: onPressed:
() { () {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'message From Driver'.tr, 'message From Driver',
controller.messageToPassenger.text, controller.messageToPassenger.text,
controller.tokenPassenger, controller.tokenPassenger,
'ding.wav'); 'ding.wav');

View File

@@ -1,4 +1,5 @@
import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:SEFER/views/widgets/mydialoug.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/constant/box_name.dart';
@@ -33,8 +34,6 @@ class OrderRequestPage extends StatelessWidget {
orderRequestController.startTimer(myList[6].toString(), body.toString()); orderRequestController.startTimer(myList[6].toString(), body.toString());
var coords = myList[0].split(','); var coords = myList[0].split(',');
var coordDestination = myList[1].split(','); var coordDestination = myList[1].split(',');
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
// Parse to double // Parse to double
double latPassengerLocation = double.parse(coords[0]); double latPassengerLocation = double.parse(coords[0]);
@@ -64,20 +63,6 @@ class OrderRequestPage extends StatelessWidget {
// Create the marker with the resized image // Create the marker with the resized image
orderRequestController.calculateConsumptionFuel(); orderRequestController.calculateConsumptionFuel();
ImageConfiguration config = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png',
mipmaps: false)
.then((value) {
startIcon = value;
});
ImageConfiguration config1 = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config1, 'assets/images/b.png',
mipmaps: false)
.then((value) {
endIcon = value;
});
// } // }
// orderRequestController.calculateConsumptionFuel(); // orderRequestController.calculateConsumptionFuel();
@@ -92,7 +77,7 @@ class OrderRequestPage extends StatelessWidget {
// SizedBox(height: 200, child: Text(pointsList.toString())), // SizedBox(height: 200, child: Text(pointsList.toString())),
// Text(message.notification!.body.toString()), // Text(message.notification!.body.toString()),
SizedBox( SizedBox(
height: Get.height * .3, height: Get.height * .33,
child: GoogleMap( child: GoogleMap(
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
zoom: 12, zoom: 12,
@@ -109,13 +94,13 @@ class OrderRequestPage extends StatelessWidget {
position: LatLng( position: LatLng(
latPassengerLocation, lngPassengerLocation), latPassengerLocation, lngPassengerLocation),
draggable: true, draggable: true,
icon: startIcon), icon: orderRequestController.startIcon),
Marker( Marker(
markerId: MarkerId('Destination'.tr), markerId: MarkerId('Destination'.tr),
position: LatLng( position: LatLng(
latPassengerDestination, lngPassengerDestination), latPassengerDestination, lngPassengerDestination),
draggable: true, draggable: true,
icon: endIcon), icon: orderRequestController.endIcon),
}, },
polylines: { polylines: {
Polyline( Polyline(
@@ -155,7 +140,7 @@ class OrderRequestPage extends StatelessWidget {
'Trip has Steps'.tr, 'Trip has Steps'.tr,
style: AppStyle.title, style: AppStyle.title,
) )
: Text('Rouats of Trip'.tr, : Text('Routs of Trip'.tr,
style: AppStyle.title)), style: AppStyle.title)),
Container( Container(
color: myList[13].toString() == 'true' color: myList[13].toString() == 'true'
@@ -209,12 +194,12 @@ class OrderRequestPage extends StatelessWidget {
)), )),
), ),
Container( Container(
height: Get.height * .2, height: Get.height * .15,
width: Get.width * .9, width: Get.width * .9,
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Column( child: ListView(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Column(
children: [ children: [
@@ -287,7 +272,7 @@ class OrderRequestPage extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(4), padding: const EdgeInsets.all(4),
child: Container( child: Container(
color: AppColor.deepPurpleAccent, color: AppColor.greenColor.withOpacity(.5),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'Cost Of Trip IS '.tr, text: 'Cost Of Trip IS '.tr,
@@ -321,68 +306,78 @@ class OrderRequestPage extends StatelessWidget {
'order_id': body.toString(), 'order_id': body.toString(),
'status': 'Apply' 'status': 'Apply'
}); });
await CRUD() var res = await CRUD().post(
.post(link: AppLink.updateRides, payload: { link: AppLink.updateRideAndCheckIfApplied,
'id': myList[16], payload: {
'rideTimeStart': DateTime.now().toString(), 'id': myList[16],
'status': 'Apply', 'rideTimeStart': DateTime.now().toString(),
'driver_id': box.read(BoxName.driverID), 'status': 'Apply',
}); 'driver_id': box.read(BoxName.driverID),
});
if (res == 'failure') {
MyDialog().getDialog(
"This ride is already applied by another driver."
.tr,
'', () {
Get.back();
});
} else {
List<String> bodyToPassenger = [
box.read(BoxName.driverID).toString(),
box.read(BoxName.nameDriver).toString(),
box.read(BoxName.tokenDriver).toString(),
];
FirebaseMessagesController()
.sendNotificationToPassengerToken(
'Apply Ride',
'your ride is applied'.tr,
// arguments['DriverList'][9].toString(),
arguments['DriverList'][9].toString(),
// box.read(BoxName.tokenDriver).toString(),
bodyToPassenger,
'start.wav');
Get.back();
box.write(BoxName.rideArguments, {
'passengerLocation': myList[0].toString(),
'passengerDestination': myList[1].toString(),
'Duration': myList[4].toString(),
'totalCost': myList[26].toString(),
'Distance': myList[5].toString(),
'name': myList[8].toString(),
'phone': myList[10].toString(),
'email': myList[28].toString(),
'WalletChecked': myList[13].toString(),
'tokenPassenger': myList[9].toString(),
'direction':
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/',
'DurationToPassenger': myList[15].toString(),
'rideId': myList[16].toString(),
'passengerId': myList[7].toString(),
'driverId': myList[18].toString(),
'durationOfRideValue': myList[19].toString(),
'paymentAmount': myList[2].toString(),
'paymentMethod': myList[13].toString() == 'true'
? 'visa'
: 'cash',
'isHaveSteps': myList[20].toString(),
'step0': myList[21].toString(),
'step1': myList[22].toString(),
'step2': myList[23].toString(),
'step3': myList[24].toString(),
'step4': myList[25].toString(),
'passengerWalletBurc': myList[26].toString(),
'timeOfOrder': DateTime.now().toString(),
'totalPassenger': myList[2].toString(),
'carType': myList[31].toString(),
'kazan': myList[32].toString(),
'startNameLocation': myList[29].toString(),
'endNameLocation': myList[30].toString(),
});
'passengerID =${box.read(BoxName.rideArguments)}';
Get.to(() => PassengerLocationMapPage(),
arguments: box.read(BoxName.rideArguments));
}
// Get.back(); // Get.back();
List<String> bodyToPassenger = [
box.read(BoxName.driverID).toString(),
box.read(BoxName.nameDriver).toString(),
box.read(BoxName.tokenDriver).toString(),
];
FirebaseMessagesController()
.sendNotificationToPassengerToken(
'Apply Ride',
'your ride is applied'.tr,
// arguments['DriverList'][9].toString(),
arguments['DriverList'][9].toString(),
// box.read(BoxName.tokenDriver).toString(),
bodyToPassenger,
'start.wav');
Get.back();
box.write(BoxName.rideArguments, {
'passengerLocation': myList[0].toString(),
'passengerDestination': myList[1].toString(),
'Duration': myList[4].toString(),
'totalCost': myList[26].toString(),
'Distance': myList[5].toString(),
'name': myList[8].toString(),
'phone': myList[10].toString(),
'email': myList[28].toString(),
'WalletChecked': myList[13].toString(),
'tokenPassenger': myList[9].toString(),
'direction':
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/',
'DurationToPassenger': myList[15].toString(),
'rideId': myList[16].toString(),
'passengerId': myList[7].toString(),
'driverId': myList[18].toString(),
'durationOfRideValue': myList[19].toString(),
'paymentAmount': myList[2].toString(),
'paymentMethod': myList[13].toString() == 'true'
? 'visa'
: 'cash',
'isHaveSteps': myList[20].toString(),
'step0': myList[21].toString(),
'step1': myList[22].toString(),
'step2': myList[23].toString(),
'step3': myList[24].toString(),
'step4': myList[25].toString(),
'passengerWalletBurc': myList[26].toString(),
'timeOfOrder': DateTime.now().toString(),
'totalPassenger': myList[2].toString(),
'carType': myList[31].toString(),
'kazan': myList[32].toString(),
'startNameLocation': myList[29].toString(),
'endNameLocation': myList[30].toString(),
});
'passengerID =${box.read(BoxName.rideArguments)}';
Get.to(() => PassengerLocationMapPage(),
arguments: box.read(BoxName.rideArguments));
}, },
), ),
GetBuilder<OrderRequestController>( GetBuilder<OrderRequestController>(
@@ -451,6 +446,6 @@ class OrderRequestPage extends StatelessWidget {
), ),
) )
], ],
isleading: true); isleading: false);
} }
} }

View File

@@ -37,8 +37,6 @@ class OrderSpeedRequest extends StatelessWidget {
myList[6].toString(), body.toString()); myList[6].toString(), body.toString());
var coords = myList[0].split(','); var coords = myList[0].split(',');
var coordDestination = myList[1].split(','); var coordDestination = myList[1].split(',');
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
// Parse to double // Parse to double
double latPassengerLocation = double.parse(coords[0]); double latPassengerLocation = double.parse(coords[0]);
@@ -68,20 +66,6 @@ class OrderSpeedRequest extends StatelessWidget {
// Create the marker with the resized image // Create the marker with the resized image
orderRequestController.calculateConsumptionFuel(); orderRequestController.calculateConsumptionFuel();
ImageConfiguration config = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png',
mipmaps: false)
.then((value) {
startIcon = value;
});
ImageConfiguration config1 = ImageConfiguration(
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config1, 'assets/images/b.png',
mipmaps: false)
.then((value) {
endIcon = value;
});
// } // }
// double mpg = 0; // double mpg = 0;
// calculateConsumptionFuel() { // calculateConsumptionFuel() {
@@ -98,7 +82,7 @@ class OrderSpeedRequest extends StatelessWidget {
// SizedBox(height: 200, child: Text(pointsList.toString())), // SizedBox(height: 200, child: Text(pointsList.toString())),
// Text(message.notification!.body.toString()), // Text(message.notification!.body.toString()),
SizedBox( SizedBox(
height: Get.height * .2, height: Get.height * .33,
child: GoogleMap( child: GoogleMap(
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
zoom: 12, zoom: 12,
@@ -115,13 +99,13 @@ class OrderSpeedRequest extends StatelessWidget {
position: position:
LatLng(latPassengerLocation, lngPassengerLocation), LatLng(latPassengerLocation, lngPassengerLocation),
draggable: true, draggable: true,
icon: startIcon), icon: orderRequestController.startIcon),
Marker( Marker(
markerId: MarkerId('Destination'.tr), markerId: MarkerId('Destination'.tr),
position: LatLng( position: LatLng(
latPassengerDestination, lngPassengerDestination), latPassengerDestination, lngPassengerDestination),
draggable: true, draggable: true,
icon: endIcon), icon: orderRequestController.endIcon),
}, },
polylines: { polylines: {
Polyline( Polyline(
@@ -161,7 +145,7 @@ class OrderSpeedRequest extends StatelessWidget {
'Trip has Steps'.tr, 'Trip has Steps'.tr,
style: AppStyle.title, style: AppStyle.title,
) )
: Text('Rouats of Trip'.tr, : Text('Routs of Trip'.tr,
style: AppStyle.title)), style: AppStyle.title)),
Container( Container(
color: myList[13].toString() == 'true' color: myList[13].toString() == 'true'
@@ -191,6 +175,21 @@ class OrderSpeedRequest extends StatelessWidget {
double.parse(myList[2]).toStringAsFixed(2), double.parse(myList[2]).toStringAsFixed(2),
style: AppStyle.headTitle2, style: AppStyle.headTitle2,
), ),
AnimatedContainer(
duration: const Duration(seconds: 5),
curve: Curves.easeInOut,
child: AnimatedSize(
duration: const Duration(seconds: 5),
curve: Curves.easeInOut,
child: myList[31].toString() == 'Comfort'
? const Icon(
Icons.ac_unit,
color: AppColor.blueColor,
size: 50,
)
: const SizedBox(),
),
),
Text( Text(
myList[31].toString(), myList[31].toString(),
style: AppStyle.title style: AppStyle.title
@@ -200,12 +199,12 @@ class OrderSpeedRequest extends StatelessWidget {
)), )),
), ),
Container( Container(
height: Get.height * .2, height: Get.height * .15,
width: Get.width * .9, width: Get.width * .9,
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Column( child: ListView(
mainAxisAlignment: MainAxisAlignment.spaceAround, // mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@@ -57,6 +57,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.2" version: "2.4.2"
asn1lib:
dependency: transitive
description:
name: asn1lib
sha256: "58082b3f0dca697204dbab0ef9ff208bfaea7767ea771076af9a343488428dda"
url: "https://pub.dev"
source: hosted
version: "1.5.3"
async: async:
dependency: transitive dependency: transitive
description: description:
@@ -361,6 +369,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.4.3+1" version: "5.4.3+1"
encrypt:
dependency: "direct main"
description:
name: encrypt
sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2"
url: "https://pub.dev"
source: hosted
version: "5.0.3"
envied: envied:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@@ -33,6 +33,7 @@ dependencies:
flutter_paypal: ^0.2.0 flutter_paypal: ^0.2.0
flutter_launcher_icons: ^0.13.1 #to be remove flutter_launcher_icons: ^0.13.1 #to be remove
# crypto: ^3.0.3 # crypto: ^3.0.3
encrypt: ^5.0.3
flutter_rating_bar: ^4.0.1 flutter_rating_bar: ^4.0.1
flutter_font_icons: ^2.2.5 flutter_font_icons: ^2.2.5
# device_info_plus: ^9.1.0 # device_info_plus: ^9.1.0