From eeb4e21f870b77b31a7a60bd8c55cdb066167aa3 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 25 Jun 2026 00:50:19 +0300 Subject: [PATCH] Update: 2026-06-25 00:50:19 --- backend/diagnose_fingerprint.php | 38 ++++++ .../lib/controller/auth/login_controller.dart | 28 ++++- .../controller/functions/package_info.dart | 2 +- .../home/map/ride_lifecycle_controller.dart | 13 +- .../profile/order_history_controller.dart | 2 +- siro_rider/lib/controller/local/ar_eg.dart | 54 ++++---- siro_rider/lib/controller/local/ar_jo.dart | 42 +++---- .../passenger_wallet_history_controller.dart | 3 +- .../profile/profile_controller.dart | 2 +- .../map_widget.dart/apply_order_widget.dart | 3 +- .../map_widget.dart/ride_begin_passenger.dart | 2 +- .../my_wallet/passenger_wallet_dialoge.dart | 119 +++++++++--------- 12 files changed, 178 insertions(+), 130 deletions(-) create mode 100644 backend/diagnose_fingerprint.php diff --git a/backend/diagnose_fingerprint.php b/backend/diagnose_fingerprint.php new file mode 100644 index 0000000..5592a90 --- /dev/null +++ b/backend/diagnose_fingerprint.php @@ -0,0 +1,38 @@ +getMessage() . "\n"; + exit; +} + +$targetId = 'e494c5750f95e1c26654'; +echo "Target Passenger ID: " . $targetId . "\n\n"; + +try { + $stmt = $con->prepare("SELECT * FROM tokens WHERE passengerID = ? LIMIT 1"); + $stmt->execute([$targetId]); + $row = $stmt->fetch(PDO::FETCH_ASSOC); + if ($row) { + echo "✅ Token row found:\n"; + echo " - Passenger ID: " . $row['passengerID'] . "\n"; + echo " - Token (encrypted/raw): " . $row['token'] . "\n"; + echo " - Fingerprint (stored): " . $row['fingerprint'] . "\n"; + + $decryptedToken = $encryptionHelper->decryptData($row['token']); + echo " - Decrypted Token: " . $decryptedToken . "\n"; + + $fpPepper = getenv('FP_PEPPER') ?: ''; + echo " - FP_PEPPER: " . ($fpPepper ? "Set" : "Not Set") . "\n"; + } else { + echo "❌ No token row found for passenger!\n"; + } +} catch (Exception $e) { + echo "❌ Error: " . $e->getMessage() . "\n"; +} diff --git a/siro_rider/lib/controller/auth/login_controller.dart b/siro_rider/lib/controller/auth/login_controller.dart index faa47f8..6ebc718 100644 --- a/siro_rider/lib/controller/auth/login_controller.dart +++ b/siro_rider/lib/controller/auth/login_controller.dart @@ -81,9 +81,9 @@ class LoginController extends GetxController { // • firstTimeLoadKey != false ← أول مرة يفتح التطبيق → loginFirstTime // • firstTimeLoadKey == false ← مستخدم موجود → loginJwtRider // ───────────────────────────────────────────────────────────── - Future getJWT() async { + Future getJWT({bool force = false}) async { // إذا كان التوكن الحالي لا يزال صالحاً، لا داعي لطلب واحد جديد - if (isTokenValid()) { + if (!force && isTokenValid()) { Log.print("JWT is still valid. Skipping request."); return; } @@ -198,6 +198,11 @@ class LoginController extends GetxController { final String decodedPayload = utf8.decode(base64Url.decode(payloadPart)); final Map payload = jsonDecode(decodedPayload); + if (payload['token_type'] == 'registration') { + Log.print("isTokenValid: Token is a registration token, treating as invalid for session."); + return false; + } + if (!payload.containsKey('exp')) { Log.print("isTokenValid: No 'exp' claim in token."); return false; @@ -278,11 +283,20 @@ class LoginController extends GetxController { payload: { 'platform': Platform.isAndroid ? 'android' : 'ios', 'appName': AppInformation.appName, + 'passengerID': passengerID, }, ); + if (res == 'token_expired' || res == 'failure' || res == 'error') { + Log.print('loginUsingCredentials: $res. Redirecting to PhoneNumberScreen to re-verify.'); + box.erase(); + storage.deleteAll(); + Get.offAll(() => PhoneNumberScreen()); + return; + } + // 2) فك JSON مرة واحدة والتحقق من النجاح - final decoded = jsonDecode(res); + final decoded = res is String ? jsonDecode(res) : res; if (decoded is! Map || decoded.isEmpty) return; if (decoded['status'] == 'failure' || decoded['status'] == 'Failure') { @@ -333,7 +347,7 @@ class LoginController extends GetxController { } // إذا لم يكن موجوداً (توافقية قديمة)، نقوم بطلبه - String? tokenResp; + dynamic tokenResp; if (serverFCM == null) { tokenResp = await CRUD().get( link: AppLink.getTokens, payload: {'passengerID': passengerID}); @@ -342,14 +356,16 @@ class LoginController extends GetxController { final localFP = (await DeviceHelper.getDeviceFingerprint()).toString(); await storage.write(key: BoxName.fingerPrint, value: localFP); await box.write(BoxName.firstTimeLoadKey, 'false'); + await getJWT(force: true); // Fetch access token after clearing firstTimeLoadKey // ── 5. المقارنة: FCM token + fingerprint ────────────────────── if (email != '962798583052@intaleqapp.com') { if (serverFCM == null && tokenResp != null && tokenResp != 'failure' && - tokenResp != 'error') { - final tokenJson = jsonDecode(tokenResp); + tokenResp != 'error' && + tokenResp != 'token_expired') { + final tokenJson = tokenResp is String ? jsonDecode(tokenResp) : tokenResp; final serverData = tokenJson['data'] ?? tokenJson['message']; if (serverData is Map) { serverFCM = serverData['token']?.toString() ?? ''; diff --git a/siro_rider/lib/controller/functions/package_info.dart b/siro_rider/lib/controller/functions/package_info.dart index 7f809a8..8062c60 100644 --- a/siro_rider/lib/controller/functions/package_info.dart +++ b/siro_rider/lib/controller/functions/package_info.dart @@ -22,7 +22,7 @@ Future checkForUpdate(BuildContext context) async { final version = packageInfo.version; Log.print('currentVersion is : $currentVersion'); // Fetch the latest version from your server - String latestVersion = box.read(BoxName.package); + String latestVersion = box.read(BoxName.package)?.toString() ?? ''; box.write(BoxName.packagInfo, version); if (latestVersion.isNotEmpty && latestVersion != currentVersion) { diff --git a/siro_rider/lib/controller/home/map/ride_lifecycle_controller.dart b/siro_rider/lib/controller/home/map/ride_lifecycle_controller.dart index 2aa7ad6..1560731 100644 --- a/siro_rider/lib/controller/home/map/ride_lifecycle_controller.dart +++ b/siro_rider/lib/controller/home/map/ride_lifecycle_controller.dart @@ -4054,15 +4054,10 @@ class RideLifecycleController extends GetxController { final bool isLoggedIn = box.read(BoxName.isVerified) == '1' && box.read(BoxName.passengerID) != null; - if (isLoggedIn) { - isDataInitializedAfterLogin = true; - getLocationArea(passengerLocation.latitude, passengerLocation.longitude); - unawaited(_stagePricingAndState()); - unawaited(_stageNiceToHave()); - startMasterTimer(); - } else { - Log.print("RideLifecycleController.onInit: User not logged in, skipping startup API calls."); - } + // We intentionally DO NOT initialize data here during onInit + // because this controller is instantiated globally before the map is opened. + // Initialization will be triggered by MapPagePassenger calling initializeDataAfterLogin() + Log.print("RideLifecycleController.onInit: Waiting for MapPagePassenger to trigger initialization."); } Future initializeDataAfterLogin() async { diff --git a/siro_rider/lib/controller/home/profile/order_history_controller.dart b/siro_rider/lib/controller/home/profile/order_history_controller.dart index 99c8ff5..56c505f 100644 --- a/siro_rider/lib/controller/home/profile/order_history_controller.dart +++ b/siro_rider/lib/controller/home/profile/order_history_controller.dart @@ -25,7 +25,7 @@ class OrderHistoryController extends GetxController { isloading = false; update(); } else { - var jsonDecoded = jsonDecode(res); + var jsonDecoded = res is String ? jsonDecode(res) : res; var rawData = jsonDecoded['data'] ?? jsonDecoded['message']; orderHistoryListPassenger = rawData is List ? rawData : []; isloading = false; diff --git a/siro_rider/lib/controller/local/ar_eg.dart b/siro_rider/lib/controller/local/ar_eg.dart index 1fb09b4..6c3c334 100644 --- a/siro_rider/lib/controller/local/ar_eg.dart +++ b/siro_rider/lib/controller/local/ar_eg.dart @@ -2,7 +2,7 @@ final Map ar_eg = { " ')[0]).toString()}.\\n\${' I am using": " ')[0]).toString()}.\\n\${' I am using", " I am currently located at ": " أنا حالياً في ", " I am using": " أنا استخدم", - " If you need to reach me, please contact the driver directly at": " إذا بغيتني، كلم الكابتن على", + " If you need to reach me, please contact the driver directly at": " إذا عاوزني، كلم الكابتن على", " KM": " كم", " Minutes": " دقائق", " Next as Cash !": " التالي كاش!", @@ -30,7 +30,7 @@ final Map ar_eg = { "1 Passenger": "راكب واحد", "1 \${'JOD": "1 \${'دينار أردني", "1 \${'LE": "1 \${'جنيه مصري", - "1. Describe Your Issue": "١. وش المشكلة؟", + "1. Describe Your Issue": "١. إيه المشكلة؟", "10 and get 4% discount": "10 وخذ خصم 4%", "100 and get 11% discount": "100 وخذ خصم 11%", "10000 \${'LE": "10000 \${'جنيه", @@ -47,13 +47,13 @@ final Map ar_eg = { "3 Passengers": "٣ ركاب", "3 digit": "3 أرقام", "3. Review Details & Response": "٣. مراجعة التفاصيل والرد", - "3000 LE": "3000 ر.س", + "3000 LE": "3000 جنيه", "4 Passengers": "٤ ركاب", "40 and get 8% discount": "40 وخذ خصم 8%", "40000 \${'LE": "40000 \${'جنيه", "5 digit": "5 أرقام", "A new version of the app is available. Please update to the latest version.": "في إصدار جديد من التطبيق. من فضلك حدّث للإصدار الأخير.", - "A trip with a prior reservation, allowing you to choose the best captains and cars.": "مشوار بحجز مسبق، يمديك تختار أفضل الكباتن والسيارات.", + "A trip with a prior reservation, allowing you to choose the best captains and cars.": "مشوار بحجز مسبق، تقدر تختار أفضل الكباتن والسيارات.", "AI Page": "صفحة الذكاء الاصطناعي", "About Intaleq": "About Intaleq", "About Siro": "عن سيرو", @@ -90,7 +90,7 @@ final Map ar_eg = { "Admin DashBoard": "لوحة التحكم", "Advanced Tools": "أدوات متقدمة", "Affordable for Everyone": "أسعار تناسب الكل", - "After this period\\nYou can't cancel!": "بعد هالوقت\\nما تقدر تلغي!", + "After this period\\nYou can't cancel!": "بعد الوقت ده\\nمش هتقدر تلغي!", "After this period\\nYou can\\'t cancel!": "بعد هذه الفترة\nلا يمكنك الإلغاء!", "After this period\nYou can't cancel!": "After this period\nYou can't cancel!", "After this period\nYou can\'t cancel!": "After this period\nYou can\'t cancel!", @@ -116,19 +116,19 @@ final Map ar_eg = { "Apply Order": "قبول الطلب", "Apply Promo Code": "طبّق كود الخصم", "Approaching your area. Should be there in 3 minutes.": "قربت منك. 3 دقايق وأكون عندك.", - "Are You sure to ride to": "متأكد تبي تروح لـ", + "Are You sure to ride to": "متأكد عاوز تروح لـ", "Are you Sure to LogOut?": "بتسجل خروج؟", - "Are you sure to cancel?": "متأكد تبي تلغي؟", - "Are you sure to delete recorded files": "متأكد تبي تحذف الملفات؟", - "Are you sure to delete this location?": "متأكد تبي تحذف هالموقع؟", - "Are you sure to delete your account?": "متأكد تبي تحذف حسابك؟", + "Are you sure to cancel?": "متأكد عاوز تلغي؟", + "Are you sure to delete recorded files": "متأكد عاوز تحذف الملفات؟", + "Are you sure to delete this location?": "متأكد عاوز تحذف الموقع ده؟", + "Are you sure to delete your account?": "متأكد عاوز تحذف حسابك؟", "Are you sure you want to delete this file?": "هل أنت متأكد من رغبتك في حذف هذا الملف؟", "Are you sure you want to logout?": "متأكد إنك عايز تسجّل خروج؟", - "Are you sure? This action cannot be undone.": "متأكد؟ ما تقدر تتراجع بعدين.", - "Are you want to change": "عايز تغيّر", - "Are you want to go this site": "تبي تروح هالمكان؟", - "Are you want to go to this site": "تبي تروح هنا؟", - "Are you want to wait drivers to accept your order": "تبي تنتظر الكباتن؟", + "Are you sure? This action cannot be undone.": "متأكد؟ مش هتقدر تتراجع بعدين.", + "Are you want to change": "هل تريد تغيير", + "Are you want to go this site": "عاوز تروح المكان ده؟", + "Are you want to go to this site": "عاوز تروح هنا؟", + "Are you want to wait drivers to accept your order": "عاوز تنتظر الكباتن؟", "Arrival time": "وقت الوصول", "Arrived": "وصل", "Associate Degree": "دبلوم", @@ -187,7 +187,7 @@ final Map ar_eg = { "Camera not initialized yet": "الكاميرا لسه", "Camera not initilaized yet": "الكاميرا لسه", "Can I cancel my ride?": "أقدر ألغي المشوار؟", - "Can we know why you want to cancel Ride ?": "ليش تبي تلغي؟", + "Can we know why you want to cancel Ride ?": "ممكن نعرف ليه عاوز تلغي؟", "Cancel": "إلغاء", "Cancel Ride": "إلغاء المشوار", "Cancel Search": "إلغاء البحث", @@ -330,7 +330,7 @@ final Map ar_eg = { "Do you have an invitation code from another driver?": "عندك كود دعوة من كابتن ثاني؟", "Do you want to change Home location": "تغير موقع البيت؟", "Do you want to change Work location": "تغير موقع الدوام؟", - "Do you want to pay Tips for this Driver": "تبي تعطي الكابتن إكرامية؟", + "Do you want to pay Tips for this Driver": "عاوز تدي الكابتن إكرامية؟", "Do you want to send an emergency message to your SOS contact?": "هل تريد إرسال رسالة طوارئ إلى جهة اتصال الطوارئ الخاصة بك؟", "Doctoral Degree": "دكتوراه", "Document Number: ": "رقم الوثيقة:", @@ -534,7 +534,7 @@ final Map ar_eg = { "How can I register as a driver?": "كيف أسجل كابتن؟", "How do I communicate with the other party (passenger/driver)?": "كيف أتواصل؟", "How do I request a ride?": "كيف أطلب مشوار؟", - "How many hours would you like to wait?": "كم ساعة تبي تنتظر؟", + "How many hours would you like to wait?": "كم ساعة عاوز تنتظر؟", "How much longer will you be?": "هتتأخر كام؟", "I Agree": "أوافق", "I Arrive your site": "وصلت موقعك", @@ -568,7 +568,7 @@ final Map ar_eg = { "Increase Fare": "زيد السعر", "Increase Fee": "زيد السعر", "Increase Your Trip Fee (Optional)": "زيد سعر المشوار (اختياري)", - "Increasing the fare might attract more drivers. Would you like to increase the price?": "لو زودت السعر ممكن يجيك كابتن أسرع. تبي تزيد السعر؟", + "Increasing the fare might attract more drivers. Would you like to increase the price?": "لو زودت السعر ممكن يجيلك كابتن أسرع. عاوز تزود السعر؟", "Insert": "إدخال", "Insert Emergincy Number": "دخل رقم الطوارئ", "Insert SOS Phone": "أدخل رقم طوارئ", @@ -607,7 +607,7 @@ final Map ar_eg = { "Is the Passenger in your Car ?": "الراكب معك؟", "Issue Date": "تاريخ الإصدار", "IssueDate": "تاريخ الإصدار", - "JOD": "ر.س", + "JOD": "دينار", "Join": "انضمام", "Join Intaleq as a driver using my referral code!": "Join Intaleq as a driver using my referral code!", "Join Siro as a driver using my referral code!": "سجل كابتن في سيرو بكود الدعوة حقي!", @@ -616,7 +616,7 @@ final Map ar_eg = { "KM": "كم", "Keep it up!": "كفو عليك!", "Kuwait": "الكويت", - "LE": "ر.س", + "LE": "جنيه", "Lady": "نواعم", "Lady Captain for girls": "كابتن سيدة للبنات", "Lady Captains Available": "كباتن سيدات", @@ -1342,7 +1342,7 @@ final Map ar_eg = { "Where are you going?": "وين رايح؟", "Where are you, sir?": "أين أنت، سيدي؟", "Where to": "وين الوجهة؟", - "Where you want go ": "وين تبي تروح ", + "Where you want go ": "عاوز تروح فين ", "Why Choose Intaleq?": "Why Choose Intaleq?", "Why Choose Siro?": "ليش سيرو؟", "Why do you want to cancel?": "لماذا تريد الإلغاء؟", @@ -1602,7 +1602,7 @@ final Map ar_eg = { "i agree": "موافق", "if you don't have account": "ما عندك حساب", "if you dont have account": "إذا ما عندك حساب", - "if you want help you can email us here": "تبي مساعدة؟ راسلنا", + "if you want help you can email us here": "عاوز مساعدة؟ راسلنا", "image verified": "الصورة تمام", "in your": "في", "insert amount": "دخل المبلغ", @@ -1663,11 +1663,11 @@ final Map ar_eg = { "similar": "مطابق", "startName'] ?? 'Start Point": "startName'] ?? 'نقطة الانطلاق", "terms of use": "شروط الاستخدام", - "the 300 points equal 300 L.E": "300 نقطة بـ 300 ر.س", - "the 300 points equal 300 L.E for you \\nSo go and gain your money": "300 نقطة تساوي 300 ر.س لك\\nرح اكسب فلوسك", + "the 300 points equal 300 L.E": "300 نقطة بـ 300 جنيه", + "the 300 points equal 300 L.E for you \\nSo go and gain your money": "300 نقطة تساوي 300 جنيه ليك\\nروح اكسب فلوسك", "the 300 points equal 300 L.E for you \nSo go and gain your money": "the 300 points equal 300 L.E for you \nSo go and gain your money", - "the 500 points equal 30 JOD": "الـ 500 نقطة تساوي 30 ر.س", - "the 500 points equal 30 JOD for you \\nSo go and gain your money": "الـ 500 نقطة بـ 30 ر.س لك\\nروح اكسب فلوسك", + "the 500 points equal 30 JOD": "الـ 500 نقطة تساوي 30 دينار", + "the 500 points equal 30 JOD for you \\nSo go and gain your money": "الـ 500 نقطة بـ 30 دينار ليك\\nروح اكسب فلوسك", "the 500 points equal 30 JOD for you \nSo go and gain your money": "the 500 points equal 30 JOD for you \nSo go and gain your money", "this will delete all files from your device": "بيمسح كل الملفات من جهازك", "to arrive you.": "يوصل ليك.", diff --git a/siro_rider/lib/controller/local/ar_jo.dart b/siro_rider/lib/controller/local/ar_jo.dart index f5d9043..ea5112a 100644 --- a/siro_rider/lib/controller/local/ar_jo.dart +++ b/siro_rider/lib/controller/local/ar_jo.dart @@ -2,7 +2,7 @@ final Map ar_jo = { " ')[0]).toString()}.\\n\${' I am using": " ')[0]).toString()}.\\n\${' I am using", " I am currently located at ": " أنا حالياً في ", " I am using": " أنا استخدم", - " If you need to reach me, please contact the driver directly at": " إذا بغيتني، كلم الكابتن على", + " If you need to reach me, please contact the driver directly at": " إذا بدك تتواصل معي، احكي مع الكابتن على", " KM": " كم", " Minutes": " دقائق", " Next as Cash !": " التالي كاش!", @@ -30,7 +30,7 @@ final Map ar_jo = { "1 Passenger": "راكب واحد", "1 \${'JOD": "1 \${'دينار أردني", "1 \${'LE": "1 \${'جنيه مصري", - "1. Describe Your Issue": "١. وش المشكلة؟", + "1. Describe Your Issue": "١. شو المشكلة؟", "10 and get 4% discount": "10 وخذ خصم 4%", "100 and get 11% discount": "100 وخذ خصم 11%", "10000 \${'LE": "10000 \${'جنيه", @@ -47,13 +47,13 @@ final Map ar_jo = { "3 Passengers": "٣ ركاب", "3 digit": "3 أرقام", "3. Review Details & Response": "٣. مراجعة التفاصيل والرد", - "3000 LE": "3000 ر.س", + "3000 LE": "3000 جنيه", "4 Passengers": "٤ ركاب", "40 and get 8% discount": "40 وخذ خصم 8%", "40000 \${'LE": "40000 \${'جنيه", "5 digit": "5 أرقام", "A new version of the app is available. Please update to the latest version.": "يتوفر إصدار جديد من التطبيق. يرجى التحديث إلى أحدث إصدار.", - "A trip with a prior reservation, allowing you to choose the best captains and cars.": "مشوار بحجز مسبق، يمديك تختار أفضل الكباتن والسيارات.", + "A trip with a prior reservation, allowing you to choose the best captains and cars.": "مشوار بحجز مسبق، بتقدر تختار أفضل الكباتن والسيارات.", "AI Page": "صفحة الذكاء الاصطناعي", "About Intaleq": "About Intaleq", "About Siro": "عن سيرو", @@ -90,7 +90,7 @@ final Map ar_jo = { "Admin DashBoard": "لوحة التحكم", "Advanced Tools": "أدوات متقدمة", "Affordable for Everyone": "أسعار تناسب الكل", - "After this period\\nYou can't cancel!": "بعد هالوقت\\nما تقدر تلغي!", + "After this period\\nYou can't cancel!": "بعد هاد الوقت\\nما بتقدر تلغي!", "After this period\\nYou can\\'t cancel!": "بعد هذه الفترة\nلا يمكنك الإلغاء!", "After this period\nYou can't cancel!": "After this period\nYou can't cancel!", "After this period\nYou can\'t cancel!": "After this period\nYou can\'t cancel!", @@ -124,11 +124,11 @@ final Map ar_jo = { "Are you sure to delete your account?": "متأكد تبي تحذف حسابك؟", "Are you sure you want to delete this file?": "هل أنت متأكد من رغبتك في حذف هذا الملف؟", "Are you sure you want to logout?": "هل أنت متأكد من تسجيل الخروج؟", - "Are you sure? This action cannot be undone.": "متأكد؟ ما تقدر تتراجع بعدين.", + "Are you sure? This action cannot be undone.": "متأكد؟ ما بتقدر تتراجع بعدين.", "Are you want to change": "هل تريد تغيير", - "Are you want to go this site": "تبي تروح هالمكان؟", - "Are you want to go to this site": "تبي تروح هنا؟", - "Are you want to wait drivers to accept your order": "تبي تنتظر الكباتن؟", + "Are you want to go this site": "بدك تروح لهاد المكان؟", + "Are you want to go to this site": "بدك تروح هون؟", + "Are you want to wait drivers to accept your order": "بدك تنتظر الكباتن؟", "Arrival time": "وقت الوصول", "Arrived": "وصل", "Associate Degree": "دبلوم", @@ -187,7 +187,7 @@ final Map ar_jo = { "Camera not initialized yet": "الكاميرا لسه", "Camera not initilaized yet": "الكاميرا لسه", "Can I cancel my ride?": "أقدر ألغي المشوار؟", - "Can we know why you want to cancel Ride ?": "ليش تبي تلغي؟", + "Can we know why you want to cancel Ride ?": "ليش بدك تلغي؟", "Cancel": "إلغاء", "Cancel Ride": "إلغاء المشوار", "Cancel Search": "إلغاء البحث", @@ -330,7 +330,7 @@ final Map ar_jo = { "Do you have an invitation code from another driver?": "عندك كود دعوة من كابتن ثاني؟", "Do you want to change Home location": "تغير موقع البيت؟", "Do you want to change Work location": "تغير موقع الدوام؟", - "Do you want to pay Tips for this Driver": "تبي تعطي الكابتن إكرامية؟", + "Do you want to pay Tips for this Driver": "بدك تعطي الكابتن إكرامية؟", "Do you want to send an emergency message to your SOS contact?": "هل تريد إرسال رسالة طوارئ إلى جهة اتصال الطوارئ الخاصة بك؟", "Doctoral Degree": "دكتوراه", "Document Number: ": "رقم الوثيقة:", @@ -534,7 +534,7 @@ final Map ar_jo = { "How can I register as a driver?": "كيف أسجل كابتن؟", "How do I communicate with the other party (passenger/driver)?": "كيف أتواصل؟", "How do I request a ride?": "كيف أطلب مشوار؟", - "How many hours would you like to wait?": "كم ساعة تبي تنتظر؟", + "How many hours would you like to wait?": "كم ساعة بدك تنتظر؟", "How much longer will you be?": "كم من الوقت ستتأخر؟", "I Agree": "أوافق", "I Arrive your site": "وصلت موقعك", @@ -568,7 +568,7 @@ final Map ar_jo = { "Increase Fare": "زيد السعر", "Increase Fee": "زيد السعر", "Increase Your Trip Fee (Optional)": "زيد سعر المشوار (اختياري)", - "Increasing the fare might attract more drivers. Would you like to increase the price?": "لو زودت السعر ممكن يجيك كابتن أسرع. تبي تزيد السعر؟", + "Increasing the fare might attract more drivers. Would you like to increase the price?": "إذا زدت السعر ممكن يجيك كابتن أسرع. بدك تزيد السعر؟", "Insert": "إدخال", "Insert Emergincy Number": "دخل رقم الطوارئ", "Insert SOS Phone": "أدخل رقم طوارئ", @@ -607,7 +607,7 @@ final Map ar_jo = { "Is the Passenger in your Car ?": "الراكب معك؟", "Issue Date": "تاريخ الإصدار", "IssueDate": "تاريخ الإصدار", - "JOD": "ر.س", + "JOD": "د.أ", "Join": "انضمام", "Join Intaleq as a driver using my referral code!": "Join Intaleq as a driver using my referral code!", "Join Siro as a driver using my referral code!": "سجل كابتن في سيرو بكود الدعوة حقي!", @@ -616,7 +616,7 @@ final Map ar_jo = { "KM": "كم", "Keep it up!": "كفو عليك!", "Kuwait": "الكويت", - "LE": "ر.س", + "LE": "جنيه", "Lady": "نواعم", "Lady Captain for girls": "كابتن سيدة للبنات", "Lady Captains Available": "كباتن سيدات", @@ -1342,7 +1342,7 @@ final Map ar_jo = { "Where are you going?": "وين رايح؟", "Where are you, sir?": "أين أنت، سيدي؟", "Where to": "وين الوجهة؟", - "Where you want go ": "وين تبي تروح ", + "Where you want go ": "وين بدك تروح ", "Why Choose Intaleq?": "Why Choose Intaleq?", "Why Choose Siro?": "ليش سيرو؟", "Why do you want to cancel?": "لماذا تريد الإلغاء؟", @@ -1602,7 +1602,7 @@ final Map ar_jo = { "i agree": "موافق", "if you don't have account": "ما عندك حساب", "if you dont have account": "إذا ما عندك حساب", - "if you want help you can email us here": "تبي مساعدة؟ راسلنا", + "if you want help you can email us here": "بدك مساعدة؟ راسلنا", "image verified": "الصورة تمام", "in your": "في", "insert amount": "دخل المبلغ", @@ -1663,11 +1663,11 @@ final Map ar_jo = { "similar": "مطابق", "startName'] ?? 'Start Point": "startName'] ?? 'نقطة الانطلاق", "terms of use": "شروط الاستخدام", - "the 300 points equal 300 L.E": "300 نقطة بـ 300 ر.س", - "the 300 points equal 300 L.E for you \\nSo go and gain your money": "300 نقطة تساوي 300 ر.س لك\\nرح اكسب فلوسك", + "the 300 points equal 300 L.E": "300 نقطة بـ 300 جنيه", + "the 300 points equal 300 L.E for you \\nSo go and gain your money": "300 نقطة تساوي 300 جنيه إلك\\nروح اكسب فلوسك", "the 300 points equal 300 L.E for you \nSo go and gain your money": "the 300 points equal 300 L.E for you \nSo go and gain your money", - "the 500 points equal 30 JOD": "الـ 500 نقطة تساوي 30 ر.س", - "the 500 points equal 30 JOD for you \\nSo go and gain your money": "الـ 500 نقطة بـ 30 ر.س لك\\nروح اكسب فلوسك", + "the 500 points equal 30 JOD": "الـ 500 نقطة تساوي 30 دينار", + "the 500 points equal 30 JOD for you \\nSo go and gain your money": "الـ 500 نقطة بـ 30 دينار إلك\\nروح اكسب فلوسك", "the 500 points equal 30 JOD for you \nSo go and gain your money": "the 500 points equal 30 JOD for you \nSo go and gain your money", "this will delete all files from your device": "بيمسح كل الملفات من جهازك", "to arrive you.": "للوصول إليك.", diff --git a/siro_rider/lib/controller/payment/passenger_wallet_history_controller.dart b/siro_rider/lib/controller/payment/passenger_wallet_history_controller.dart index 54fbc61..b50f716 100644 --- a/siro_rider/lib/controller/payment/passenger_wallet_history_controller.dart +++ b/siro_rider/lib/controller/payment/passenger_wallet_history_controller.dart @@ -23,7 +23,8 @@ class PassengerWalletHistoryController extends GetxController { ); if (res != 'failure') { - archive = jsonDecode(res)['message']; + final decoded = res is String ? jsonDecode(res) : res; + archive = decoded['message']; } else { MyDialog().getDialog('No wallet record found'.tr, '', () { Get.back(); diff --git a/siro_rider/lib/controller/profile/profile_controller.dart b/siro_rider/lib/controller/profile/profile_controller.dart index 188379e..0b89ad9 100644 --- a/siro_rider/lib/controller/profile/profile_controller.dart +++ b/siro_rider/lib/controller/profile/profile_controller.dart @@ -98,7 +98,7 @@ class ProfileController extends GetxController { isloading = false; update(); } else { - var jsonDecoded = jsonDecode(res); + var jsonDecoded = res is String ? jsonDecode(res) : res; prfoileData = jsonDecoded['data']; box.write(BoxName.sosPhonePassenger, prfoileData['sosPhone'].toString()); box.write(BoxName.gender, prfoileData['gender'].toString()); diff --git a/siro_rider/lib/views/home/map_widget.dart/apply_order_widget.dart b/siro_rider/lib/views/home/map_widget.dart/apply_order_widget.dart index e126b1b..1a6608d 100644 --- a/siro_rider/lib/views/home/map_widget.dart/apply_order_widget.dart +++ b/siro_rider/lib/views/home/map_widget.dart/apply_order_widget.dart @@ -113,7 +113,8 @@ class ApplyOrderWidget extends StatelessWidget { BuildContext context, RideLifecycleController controller) { // تنسيق السعر final formatter = NumberFormat("#,###"); - String formattedPrice = formatter.format(controller.totalPassenger); + num totalVal = num.tryParse(controller.totalPassenger.toString()) ?? 0; + String formattedPrice = formatter.format(totalVal); // حساب الدقائق من الوقت المتبقي الحي، وليس ETA الأصلي فقط. final int secondsToPassenger = diff --git a/siro_rider/lib/views/home/map_widget.dart/ride_begin_passenger.dart b/siro_rider/lib/views/home/map_widget.dart/ride_begin_passenger.dart index 7df7199..37d5f51 100644 --- a/siro_rider/lib/views/home/map_widget.dart/ride_begin_passenger.dart +++ b/siro_rider/lib/views/home/map_widget.dart/ride_begin_passenger.dart @@ -203,7 +203,7 @@ class RideBeginPassenger extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - NumberFormat('#,###').format(controller.totalPassenger), + NumberFormat('#,###').format(num.tryParse(controller.totalPassenger.toString()) ?? 0), style: const TextStyle( fontWeight: FontWeight.w900, fontSize: 16, diff --git a/siro_rider/lib/views/home/my_wallet/passenger_wallet_dialoge.dart b/siro_rider/lib/views/home/my_wallet/passenger_wallet_dialoge.dart index 474b6cc..4845d83 100644 --- a/siro_rider/lib/views/home/my_wallet/passenger_wallet_dialoge.dart +++ b/siro_rider/lib/views/home/my_wallet/passenger_wallet_dialoge.dart @@ -131,67 +131,61 @@ void showPaymentBottomSheet(BuildContext context) { borderRadius: BorderRadius.vertical(top: Radius.circular(15.0)), ), builder: (BuildContext context) { - return PopScope( - canPop: true, - onPopInvokedWithResult: (didPop, result) async { - Get.back(); - }, - child: Container( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - 'Select Payment Amount'.tr, - style: AppStyle.headTitle2, - textAlign: TextAlign.center, - ), - const SizedBox(height: 16.0), + return Container( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + 'Select Payment Amount'.tr, + style: AppStyle.headTitle2, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16.0), - // Payment Options List - _buildPaymentOption( - context: context, - controller: controller, - amount: 500, - bonusAmount: 30, - currency: CurrencyHelper.currency, - ), + // Payment Options List + _buildPaymentOption( + context: context, + controller: controller, + amount: 500, + bonusAmount: 30, + currency: CurrencyHelper.currency, + ), - const SizedBox(height: 8.0), - _buildPaymentOption( - context: context, - controller: controller, - amount: 1000, - bonusAmount: 70, - currency: CurrencyHelper.currency, - ), + const SizedBox(height: 8.0), + _buildPaymentOption( + context: context, + controller: controller, + amount: 1000, + bonusAmount: 70, + currency: CurrencyHelper.currency, + ), - const SizedBox(height: 8.0), - _buildPaymentOption( - context: context, - controller: controller, - amount: 2000, - bonusAmount: 180, - currency: CurrencyHelper.currency, - ), + const SizedBox(height: 8.0), + _buildPaymentOption( + context: context, + controller: controller, + amount: 2000, + bonusAmount: 180, + currency: CurrencyHelper.currency, + ), - const SizedBox(height: 8.0), - _buildPaymentOption( - context: context, - controller: controller, - amount: 5000, - bonusAmount: 700, - currency: CurrencyHelper.currency, - ), + const SizedBox(height: 8.0), + _buildPaymentOption( + context: context, + controller: controller, + amount: 5000, + bonusAmount: 700, + currency: CurrencyHelper.currency, + ), - const SizedBox(height: 16.0), - TextButton( - onPressed: () => Get.back(), - child: Text('Cancel'.tr), - ), - ], - ), + const SizedBox(height: 16.0), + TextButton( + onPressed: () => Get.back(), + child: Text('Cancel'.tr), + ), + ], ), ); }, @@ -445,12 +439,15 @@ void showPaymentOptions(BuildContext context, PaymentController controller) { borderRadius: BorderRadius.circular(10), color: Colors.transparent, ), - child: ListTile( - title: Text( - 'Pay by Cliq'.tr, - style: AppStyle.title, + child: Material( + color: Colors.transparent, + child: ListTile( + title: Text( + 'Pay by Cliq'.tr, + style: AppStyle.title, + ), + trailing: const Icon(Icons.payment, size: 40, color: Colors.green), ), - trailing: const Icon(Icons.payment, size: 40, color: Colors.green), ), )), if (box.read(BoxName.countryCode) == 'Syria') GestureDetector(