diff --git a/.env b/.env index cde128d..bb4b7b6 100644 --- a/.env +++ b/.env @@ -42,98 +42,57 @@ payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl' keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl -a= q -b= x -c= f -d= y -e= j -f= u -g= k -h= w -i= o -j= e -k= g -l= r -m= n -n= b -o= i -p= v -q= a -r= l -s= z -t= c -u= h -v= p -w= t -x= d -y= s -z= m -A= Q -B= X -C= F -D= Y -E= J -F= U -G= K -H= W -I= O -J= E -K= G -L= R -M= N -N= B -O= I -P= V -Q= A -R= L -S= Z -T= C -U= H -V= P -W= T -X= D -Y= S -Z= M -# -#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= bWjMqX8G7gUyLhrQ85zAXSe2YLffF62PaPHyYK1WcQTPTjcj2+sRswzOU1XPVu+n -#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 \ No newline at end of file +a=q +b=x +c=f +d=y +e=j +f=u +g=k +h=w +i=o +j=e +k=g +l=r +m=n +n=b +o=i +p=v +q=a +r=l +s=z +t=c +u=h +v=p +w=t +x=d +y=s +z=m + +A=Q +B=X +C=F +D=Y +E=J +F=U +G=K +H=W +I=O +J=E +K=G +L=R +M=N +N=B +O=I +P=V +Q=A +R=L +S=Z +T=C +U=H +V=P +W=T +X=D +Y=S +Z=M \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 7c1dc7b..ce5e9e3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -55,8 +55,8 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 23 targetSdkVersion 33 - versionCode 48 - versionName '1.5.48' + versionCode 49 + versionName '1.5.49' // manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml'] } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 069d2a2..3e69970 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -491,7 +491,7 @@ SPEC CHECKSUMS: MLKitTextRecognitionCommon: c0b3a63d529296a19bce1f8bc8a513644ed4d1f6 MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1 nanopb: 438bc412db1928dac798aa6fd75726007be04262 - package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 + package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 @@ -513,7 +513,7 @@ SPEC CHECKSUMS: url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241 video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1 - wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47 + wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 PODFILE CHECKSUM: 0bad49c413ac3d5029f2e67f7b21b01b6b7d5085 diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index a92da10..7df1adb 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 46 + 47 CFBundleSignature ???? CFBundleURLTypes @@ -36,7 +36,7 @@ CFBundleVersion - 4.0.46 + 4.0.47 FirebaseAppDelegateProxyEnabled NO GMSApiKey diff --git a/lib/constant/api_key.dart b/lib/constant/api_key.dart index dc2c108..3cea15d 100644 --- a/lib/constant/api_key.dart +++ b/lib/constant/api_key.dart @@ -69,77 +69,6 @@ class AK { static final String payMobOutUserName = a.r(a.r(a.r(Env.payMobOutUserName, cn), cC), cs); - ///////////// +/////////// static final String keyOfApp = a.r(a.r(a.r(Env.keyOfApp, 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); -// } diff --git a/lib/constant/box_name.dart b/lib/constant/box_name.dart index dc7a43f..ed95722 100644 --- a/lib/constant/box_name.dart +++ b/lib/constant/box_name.dart @@ -10,7 +10,9 @@ class BoxName { static const String phoneVerified = "phoneVerified"; static const String carPlate = "carPlate"; static const String statusDriverLocation = "statusDriverLocation"; + static const String rideStatus = "rideStatus"; static const String password = "password"; + static const String isVerified = '0'; static const String arrivalTime = "arrivalTime"; static const String locationPermission = "locationPermission"; static const String passwordDriver = "passwordDriver"; diff --git a/lib/constant/char_map.dart b/lib/constant/char_map.dart index 33e5017..ca5ee37 100644 --- a/lib/constant/char_map.dart +++ b/lib/constant/char_map.dart @@ -1,17 +1,5 @@ -import 'package:SEFER/env/env.dart'; +import '../env/env.dart'; -Map cn = { - "0": "3", - "1": "7", - "2": "1", - "3": "9", - "4": "0", - "5": "5", - "6": "2", - "7": "6", - "8": "4", - "9": "8" -}; Map cs = { "a": Env.a, "b": Env.b, @@ -68,3 +56,20 @@ Map cC = { "Y": Env.Y, "Z": Env.Z }; + +// + +// + +Map cn = { + "0": "3", + "1": "7", + "2": "1", + "3": "9", + "4": "0", + "5": "5", + "6": "2", + "7": "6", + "8": "4", + "9": "8" +}; diff --git a/lib/constant/links.dart b/lib/constant/links.dart index b2d9eaf..5bfc4d7 100644 --- a/lib/constant/links.dart +++ b/lib/constant/links.dart @@ -1,3 +1,4 @@ +import 'package:SEFER/constant/api_key.dart'; import 'package:SEFER/env/env.dart'; class AppLink { @@ -112,6 +113,8 @@ class AppLink { static String getCnMap = "$server/auth/cnMap.php"; static String updateApiKey = "$ride/apiKey/update.php"; static String deleteApiKey = "$ride/apiKey/delete.php"; + static String checkPhoneNumberISVerfiedDriver = + "$auth/checkPhoneNumberISVerfiedDriver.php"; //-----------------Feed Back------------------ static String addFeedBack = "$ride/feedBack/add.php"; diff --git a/lib/controller/auth/captin/register_captin_controller.dart b/lib/controller/auth/captin/register_captin_controller.dart index ece4c79..7cd8a2e 100644 --- a/lib/controller/auth/captin/register_captin_controller.dart +++ b/lib/controller/auth/captin/register_captin_controller.dart @@ -14,6 +14,7 @@ import 'package:SEFER/main.dart'; import 'package:SEFER/views/auth/captin/login_captin.dart'; import 'package:SEFER/views/auth/captin/verify_email_captain.dart'; +import '../../../constant/colors.dart'; import '../../../views/auth/captin/ai_page.dart'; import '../../../views/auth/captin/car_license_page.dart'; import '../../../views/home/Captin/home_captain/home_captin.dart'; @@ -86,16 +87,33 @@ class RegisterCaptainController extends GetxController { update(); if (formKey3.currentState!.validate()) { if (box.read(BoxName.countryCode) == 'Egypt') { - await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { + var responseCheker = await CRUD() + .post(link: AppLink.checkPhoneNumberISVerfiedDriver, payload: { 'phone_number': '+2${phoneController.text}', - 'token_code': randomNumber.toString(), }); + var d = jsonDecode(responseCheker); + if (d['message'][0]['is_verified'].toString() == '1') { + Get.snackbar('Phone number is verified before'.tr, '', + backgroundColor: AppColor.greenColor); + box.write(BoxName.isVerified, '1'); + box.write(BoxName.phone, '+2${phoneController.text}'); + await Get.put(LoginDriverController()).loginUsingCredentials( + box.read(BoxName.driverID).toString(), + box.read(BoxName.emailDriver).toString(), + ); + } else { + await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { + 'phone_number': '+2${phoneController.text}', + 'token_code': randomNumber.toString(), + }); - await smsEgyptController.sendSmsEgypt( - phoneController.text.toString(), randomNumber.toString()); - isSent = true; - isLoading = false; - update(); + await smsEgyptController.sendSmsEgypt( + phoneController.text.toString(), randomNumber.toString()); + isSent = true; + + isLoading = false; + update(); + } } } } diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart index b4d2440..5dd709c 100644 --- a/lib/controller/firebase/firbase_messge.dart +++ b/lib/controller/firebase/firbase_messge.dart @@ -243,6 +243,7 @@ class FirebaseMessagesController extends GetxController { confirm: MyElevatedButton( title: 'Ok'.tr, onPressed: () { + box.write(BoxName.rideStatus, 'Cancel'); Get.offAll(HomeCaptain()); })); } diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart index 984b88b..4dc8c67 100644 --- a/lib/controller/functions/crud.dart +++ b/lib/controller/functions/crud.dart @@ -27,9 +27,6 @@ class CRUD { 'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}', }, ); - print(response.request); - print(response.body); - print(response.statusCode); // if (response.statusCode == 200) { var jsonData = jsonDecode(response.body); if (jsonData['status'] == 'success') { @@ -101,7 +98,6 @@ class CRUD { await arabicTextExtractByVisionAndAI(imagePath: imagePath); var json = jsonDecode(extractedString); var textValues = extractTextFromLines(json); - print(textValues); // await Get.put(AI()).geminiAiExtraction(prompt, textValues); await Get.put(AI()).anthropicAI(textValues, prompt, imagePath); } @@ -134,8 +130,6 @@ class CRUD { String imagePathFull = '${AppLink.server}/card_image/$imagePath-${box.read(BoxName.driverID)}.jpg'; - // print(box.read(BoxName.driverID)); - // print(imagePathFull); var request = http.Request('POST', Uri.parse( // 'https://ocrhamza.cognitiveservices.azure.com/vision/v2.1/ocr?language=ar')); // 'https://eastus.api.cognitive.microsoft.com/vision/v3.2/ocr' @@ -146,7 +140,6 @@ class CRUD { http.StreamedResponse response = await request.send(); if (response.statusCode == 200) { - // print(await response.stream.bytesToString()); return await response.stream.bytesToString(); } else {} } @@ -224,9 +217,6 @@ class CRUD { 'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}', }, ); - print(response.request); - print(response.body); - // print(response.statusCode); var jsonData = jsonDecode(response.body); if (response.statusCode == 200) { if (jsonData['status'] == 'success') { diff --git a/lib/controller/functions/encrypt.dart b/lib/controller/functions/encrypt.dart index fd79daf..3457614 100644 --- a/lib/controller/functions/encrypt.dart +++ b/lib/controller/functions/encrypt.dart @@ -18,7 +18,10 @@ class KeyEncryption { } static String decryptKey(String encryptedKey) { + print('encryptedKey: ${AK.keyOfApp}'); + final decoded = base64Decode(encryptedKey); + print('encryptedKey: $encryptedKey'); final iv = encrypt.IV(decoded.sublist(0, 16)); // استخراج التهيئة final encrypted = encrypt.Encrypted(decoded.sublist(16)); // استخراج النص المشفر diff --git a/lib/controller/functions/package_info.dart b/lib/controller/functions/package_info.dart index b8bfbdf..29bab09 100644 --- a/lib/controller/functions/package_info.dart +++ b/lib/controller/functions/package_info.dart @@ -12,6 +12,7 @@ import '../../constant/info.dart'; Future checkForUpdate(BuildContext context) async { final packageInfo = await PackageInfo.fromPlatform(); final currentVersion = packageInfo.buildNumber; + final version = packageInfo.version; print('currentVersion is : $currentVersion'); // Fetch the latest version from your server String latestVersion = await getPackageInfo(); @@ -24,7 +25,7 @@ Future checkForUpdate(BuildContext context) async { Future getPackageInfo() async { final response = await CRUD().get(link: AppLink.packageInfo, payload: { "platform": Platform.isAndroid ? 'android' : 'ios', - "appName": AppInformation.appName, + "appName": AppInformation.appVersion, }); if (response != 'failure') { @@ -36,7 +37,7 @@ Future getPackageInfo() async { void showUpdateDialog(BuildContext context) { final String storeUrl = Platform.isAndroid ? 'https://play.google.com/store/apps/details?id=com.sefer_driver' - : 'https://apps.apple.com/ae/app/sefer/id6458734951'; + : 'https://apps.apple.com/ae/app/sefer-driver/id6502189302'; showCupertinoDialog( context: context, barrierDismissible: false, diff --git a/lib/controller/functions/sms_egypt_controller.dart b/lib/controller/functions/sms_egypt_controller.dart index 19625d2..17ae75b 100644 --- a/lib/controller/functions/sms_egypt_controller.dart +++ b/lib/controller/functions/sms_egypt_controller.dart @@ -13,6 +13,7 @@ class SmsEgyptController extends GetxController { var headers = {'Content-Type': 'application/json'}; Future sendSmsEgypt(String phone, otp) async { + print('password ==== ${AK.smsPasswordEgypt}'); var body = jsonEncode({ "username": AppInformation.appName, "password": AK.smsPasswordEgypt, //'E)Pu=an/@Z', diff --git a/lib/controller/home/captin/map_driver_controller.dart b/lib/controller/home/captin/map_driver_controller.dart index 173fbdd..07e5f0e 100644 --- a/lib/controller/home/captin/map_driver_controller.dart +++ b/lib/controller/home/captin/map_driver_controller.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; +import 'package:SEFER/views/widgets/mydialoug.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:get/get.dart'; @@ -221,6 +222,7 @@ class MapDriverController extends GetxController { 'driverGoToPassengerTime': DateTime.now().toString(), 'status': 'Applied' }); + box.write(BoxName.rideStatus, 'Applied'); FirebaseMessagesController().sendNotificationToAnyWithoutData( 'DriverIsGoingToPassenger', box.read(BoxName.name).toString(), @@ -282,6 +284,7 @@ class MapDriverController extends GetxController { remainingTimeInPassengerLocatioWait = 0; timeWaitingPassenger = 0; box.write(BoxName.statusDriverLocation, 'on'); + box.write(BoxName.rideStatus, 'Begin'); //todo ride details update(); await CRUD().post(link: AppLink.updateRides, payload: { @@ -426,6 +429,12 @@ class MapDriverController extends GetxController { } void finishRideFromDriver() { + double distanceToDestination = Geolocator.distanceBetween( + latLngPassengerLocation.latitude, + latLngPassengerLocation.longitude, + Get.find().myLocation.latitude, + Get.find().myLocation.longitude, + ); Get.defaultDialog( title: 'Are you sure to exit ride ?'.tr, titleStyle: AppStyle.title, @@ -434,8 +443,16 @@ class MapDriverController extends GetxController { title: 'Ok'.tr, kolor: AppColor.greenColor, onPressed: () { - Get.back(); - finishRideFromDriver1(); + if (distanceToDestination > 1000) { + Get.back(); + finishRideFromDriver1(); + } else { + Get.back(); + if (distanceToDestination < 150) { + // todo add scam from start point and dont move + } + MyDialog().getDialog('you are not moved yet !'.tr, '', () {}); + } }), cancel: MyElevatedButton( title: 'Cancel'.tr, @@ -467,17 +484,12 @@ class MapDriverController extends GetxController { } void finishRideFromDriver1() async { - double distanceToDestination = Geolocator.distanceBetween( - latLngPassengerDestination.latitude, - latLngPassengerDestination.longitude, - Get.find().myLocation.latitude, - Get.find().myLocation.longitude, - ); // if (carType != 'Comfort' || carType != 'Free Ride') { - // if (distanceToDestination < 50) { + isRideFinished = true; isRideStarted = false; isPriceWindow = false; + box.write(BoxName.rideStatus, 'Finished'); totalCost = price < 30 ? carType != 'Comfort' && carType != 'Mashwari' && carType != 'Lady' ? '20' @@ -559,7 +571,6 @@ class MapDriverController extends GetxController { 'walletChecked': walletChecked }); // Get.back(); - // } } void cancelCheckRideFromPassenger() async { @@ -599,7 +610,9 @@ class MapDriverController extends GetxController { int durationOfRide = int.parse(durationOfRideValue); update(); int infinity = 40000; - if (carType == 'Comfort' || carType == 'Mashwari') { + if (carType == 'Comfort' || + carType == 'Mashwari' || + carType == 'Rayeh Gai') { durationOfRide = infinity; update(); } @@ -637,7 +650,7 @@ class MapDriverController extends GetxController { remainingTimeTimerRideBegin = durationOfRide - i; remainingTimeTimerRideBegin < 60 ? driverEndPage = 160 : 100; updateMarker(); - if (remainingTimeTimerRideBegin < 120) { + if (remainingTimeTimerRideBegin < 60) { // to make driver available on last 2 minute in his trip box.write(BoxName.statusDriverLocation, 'off'); } diff --git a/lib/controller/home/splash_screen_controlle.dart b/lib/controller/home/splash_screen_controlle.dart index f6e1c2e..1b81180 100644 --- a/lib/controller/home/splash_screen_controlle.dart +++ b/lib/controller/home/splash_screen_controlle.dart @@ -4,6 +4,7 @@ import 'package:SEFER/controller/auth/captin/login_captin_controller.dart'; import 'package:SEFER/views/home/on_boarding_page.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import '../../constant/box_name.dart'; import '../../main.dart'; @@ -16,10 +17,23 @@ class SplashScreenController extends GetxController late Animation zoomInAnimation; late Animation zoomOutAnimation; + String packageInfo = ''; + late String version = '1.5.48'; + Future checkForUpdate() async { + final packageInfo = await PackageInfo.fromPlatform(); + final currentVersion = packageInfo.buildNumber; + final version1 = packageInfo.version; + print('currentVersion is : $currentVersion'); + // Fetch the latest version from your server + version = version1.toString(); + print('version: ${version}'); + update(); + } + @override void onInit() { super.onInit(); - + checkForUpdate(); animationController = AnimationController( vsync: this, duration: const Duration(seconds: 4), diff --git a/lib/controller/local/translations.dart b/lib/controller/local/translations.dart index 6085129..74d3d6f 100644 --- a/lib/controller/local/translations.dart +++ b/lib/controller/local/translations.dart @@ -4,6 +4,8 @@ class MyTranslation extends Translations { @override Map> get keys => { "ar": { + "don't start trip if not": "لا تبدأ الرحلة إذا لم", + "you are not moved yet !": "أنت لم تتحرك بعد!", "Update Available": "تحديث متوفر", "A new version of the app is available. Please update to the latest version.": "تتوفر نسخة جديدة من التطبيق. يرجى التحديث إلى أحدث إصدار.", diff --git a/lib/splash_screen_page.dart b/lib/splash_screen_page.dart index b0ae419..0b726bc 100644 --- a/lib/splash_screen_page.dart +++ b/lib/splash_screen_page.dart @@ -64,7 +64,14 @@ class SplashScreen extends StatelessWidget { AppStyle.title.copyWith(color: AppColor.primaryColor), speed: const Duration(milliseconds: 200), ), - ], isRepeatingAnimation: true) + ], isRepeatingAnimation: true), + const SizedBox( + height: 100, + ), + Text( + splashScreenController.version.toString(), + style: AppStyle.title, + ), ], ), ), diff --git a/lib/views/home/Captin/home_captain/home_captin.dart b/lib/views/home/Captin/home_captain/home_captin.dart index 6f4c3a7..29583f0 100644 --- a/lib/views/home/Captin/home_captain/home_captin.dart +++ b/lib/views/home/Captin/home_captain/home_captin.dart @@ -1,3 +1,5 @@ +import 'package:SEFER/constant/box_name.dart'; +import 'package:SEFER/controller/home/captin/map_driver_controller.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; @@ -14,6 +16,7 @@ import '../../../../controller/functions/package_info.dart'; import '../../../../controller/home/captin/home_captain_controller.dart'; import '../../../../controller/home/captin/order_request_controller.dart'; import '../../../widgets/circle_container.dart'; +import '../driver_map_page.dart'; import 'widget/connect.dart'; import 'widget/left_menu_map_captain.dart'; import '../../../../controller/home/payment/captain_wallet_controller.dart'; @@ -237,6 +240,43 @@ class HomeCaptain extends StatelessWidget { // ), // ), leftMainMenuCaptainIcons(), + box.read(BoxName.rideStatus) == 'Applied' || + box.read(BoxName.rideStatus) == 'Begin' + ? Positioned( + bottom: Get.height * .2, + right: 6, + child: AnimatedContainer( + duration: const Duration(microseconds: 200), + width: homeCaptainController.widthMapTypeAndTraffic, + decoration: BoxDecoration( + border: Border.all(color: AppColor.blueColor), + color: AppColor.secondaryColor, + borderRadius: BorderRadius.circular(15)), + child: IconButton( + onPressed: () { + box.read(BoxName.rideStatus) == 'Applied' + ? { + Get.to(() => PassengerLocationMapPage(), + arguments: box.read(BoxName.rideArguments)), + Get.find() + .driverGoToPassenger() + } + : { + Get.to(() => PassengerLocationMapPage(), + arguments: box.read(BoxName.rideArguments)), + Get.find() + .changeRideToBeginToPassenger() + }; + }, + icon: const Icon( + Icons.rice_bowl, + size: 29, + color: AppColor.blueColor, + ), + ), + ), + ) + : SizedBox() // callPage(), // Positioned( diff --git a/lib/views/home/Captin/home_captain/widget/left_menu_map_captain.dart b/lib/views/home/Captin/home_captain/widget/left_menu_map_captain.dart index 4e726f8..c55973f 100644 --- a/lib/views/home/Captin/home_captain/widget/left_menu_map_captain.dart +++ b/lib/views/home/Captin/home_captain/widget/left_menu_map_captain.dart @@ -1,17 +1,12 @@ import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/main.dart'; -import 'package:SEFER/views/home/Captin/driver_map_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_font_icons/flutter_font_icons.dart'; import 'package:get/get.dart'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import '../../../../../constant/char_map.dart'; import '../../../../../constant/colors.dart'; -import '../../../../../constant/credential.dart'; -import '../../../../../controller/functions/encrypt.dart'; -import '../../../../../controller/functions/launch.dart'; import '../../../../Rate/ride_calculate_driver.dart'; import '../../../../../controller/functions/location_controller.dart'; @@ -22,55 +17,60 @@ GetBuilder leftMainMenuCaptainIcons() { left: 6, child: Column( children: [ - AnimatedContainer( - duration: const Duration(microseconds: 200), - width: controller.widthMapTypeAndTraffic, - decoration: BoxDecoration( - border: Border.all(color: AppColor.blueColor), - color: AppColor.secondaryColor, - borderRadius: BorderRadius.circular(15)), - child: IconButton( - onPressed: () { - // AC credentials = AC(); - String apiKey = 'maldev@2101hamzaayedseferegyptjo'; - // String convertedStringN = credentials.c( - // credentials.c(credentials.c(apiKey, cs), cC), cn); - // print(convertedStringN); - // String retrievedStringS = credentials.r( - // credentials.r(credentials.r(convertedStringN, cn), cC), - // cs); - // print(retrievedStringS); - // // - // if (retrievedStringS == apiKey) { - // print('same'); - // } + // AnimatedContainer( + // duration: const Duration(microseconds: 200), + // width: controller.widthMapTypeAndTraffic, + // decoration: BoxDecoration( + // border: Border.all(color: AppColor.blueColor), + // color: AppColor.secondaryColor, + // borderRadius: BorderRadius.circular(15)), + // child: IconButton( + // onPressed: () { + // // AC credentials = AC(); + // + // // String apikey = AK.passwordPayMob; + // // String convertedStringN = credentials.c( + // // credentials.c(credentials.c(apikey, cs), cC), cn); + // // print(convertedStringN); + // // String retrievedStringS = credentials.r( + // // credentials.r(credentials.r(convertedStringN, cn), cC), + // // cs); + // // print(retrievedStringS); + // // // + // // if (retrievedStringS == + // // 'apikey') { + // // print('same'); + // // } - // key.forEach((key, apiKey) { + // // key.forEach((key, apiKey) { + // // Get.to(() => SmsSignupEgypt()); + // // keys.forEach((key, apiKey) { + // // String retrievedStringS = credentials.r( + // // credentials.r(credentials.r(apiKey, cn), cC), cs); + // // String encryptedApiKey = + // // KeyEncryption.encryptKey(retrievedStringS); + // // print('$key=$encryptedApiKey'); - // keys.forEach((key, apiKey) { - String encryptedApiKey = KeyEncryption.encryptKey(apiKey); - print('Encrypted API Key for : $encryptedApiKey'); + // // String decryptedApiKey = + // // KeyEncryption.decryptKey(encryptedApiKey); + // // print('Decrypted API Key for : $decryptedApiKey'); - String decryptedApiKey = KeyEncryption.decryptKey( - "Hsd7tLdt4ZsSRMCCs0xia2ct9O1jrJKyZu6pvh6MjL8qg6TkJ9FZCW4H/OqCkMjtokBOTdTX0P2sASLTcTxBVA=="); - print('Decrypted API Key for : $decryptedApiKey'); - - if (decryptedApiKey == apiKey) { - print('Keys match for '); - } else { - print('Keys do not match for '); - } - // }); - }, - icon: const Icon( - FontAwesome.map_signs, - size: 24, - color: Colors.black, - )), - ), - const SizedBox( - height: 5, - ), + // // if (decryptedApiKey == apiKey) { + // // print('Keys match for '); + // // } else { + // // print('Keys do not match for '); + // // } + // // }); + // }, + // icon: const Icon( + // FontAwesome.map_signs, + // size: 24, + // color: Colors.black, + // )), + // ), + // const SizedBox( + // height: 5, + // ), AnimatedContainer( duration: const Duration(microseconds: 200), width: controller.widthMapTypeAndTraffic, diff --git a/lib/views/home/Captin/mapDriverWidgets/passenger_info_window.dart b/lib/views/home/Captin/mapDriverWidgets/passenger_info_window.dart index b1037ef..56a7c87 100644 --- a/lib/views/home/Captin/mapDriverWidgets/passenger_info_window.dart +++ b/lib/views/home/Captin/mapDriverWidgets/passenger_info_window.dart @@ -223,8 +223,7 @@ class PassengerInfoWindow extends StatelessWidget { height: 5, ), SizedBox( - width: Get.width * - .5, + width: 200, child: Row( mainAxisAlignment: MainAxisAlignment @@ -235,8 +234,8 @@ class PassengerInfoWindow extends StatelessWidget { .formKey2, child: SizedBox( - width: Get.width * - .4, + width: + 160, child: MyTextForm( controller: controller.messageToPassenger, @@ -248,7 +247,7 @@ class PassengerInfoWindow extends StatelessWidget { onPressed: () { FirebaseMessagesController().sendNotificationToAnyWithoutData( - 'message From Driver', + 'message From Driver'.tr, controller.messageToPassenger.text, controller.tokenPassenger, 'ding.wav'); @@ -413,7 +412,7 @@ class PassengerInfoWindow extends StatelessWidget { titleStyle: AppStyle.title, middleText: - 'don\'t start trip if not ' + "don't start trip if not" .tr, middleTextStyle: AppStyle.title,