26-1-22/3

This commit is contained in:
Hamza-Ayed
2026-01-22 23:00:43 +03:00
parent b77222a9cd
commit da12f1792d
4 changed files with 19 additions and 11 deletions

View File

@@ -47,8 +47,8 @@ android {
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23 minSdk = 23
targetSdk = 36 targetSdk = 36
versionCode = 57 versionCode = 58
versionName = '1.0.57' versionName = '1.1.58'
multiDexEnabled = true multiDexEnabled = true
ndk { ndk {
abiFilters "armeabi-v7a", "arm64-v8a" abiFilters "armeabi-v7a", "arm64-v8a"

View File

@@ -967,13 +967,9 @@ class MapPassengerController extends GetxController {
} }
} }
// أضف هذا في دالة onClose الرئيسية للكنترولر /// ==============================================================================
// override onClose() { /// 6. معالجة تحديث موقع السائق من السوكيت
// disposeRideSocket(); /// ==============================================================================
// _stopDriverLocationPolling();
// super.onClose();
// }
// === معالج جديد لموقع السائق ===
void handleDriverLocationUpdate(dynamic data) { void handleDriverLocationUpdate(dynamic data) {
if (!isSocketConnected || data == null) return; if (!isSocketConnected || data == null) return;
// 🔥 1. تسجيل وقت استلام البيانات (تغذية الـ Watchdog) // 🔥 1. تسجيل وقت استلام البيانات (تغذية الـ Watchdog)
@@ -995,6 +991,15 @@ class MapPassengerController extends GetxController {
} }
currentLocationOfDrivers = newPos; currentLocationOfDrivers = newPos;
// ------------------------------------------------------------------
// 🔥 تحديث الكاميرا: ضمان بقاء السيارة في منتصف الخريطة
// ------------------------------------------------------------------
// ملاحظة: تأكد من أن mapController قد تم تهيئته (initialized)
if (mapController != null) {
// نستخدم animateCamera لحركة ناعمة بدلاً من moveCamera القاسية
mapController!.animateCamera(CameraUpdate.newLatLng(newPos));
}
// ------------------------------------------------------------------
// تحديث الوقت المتبقي (إذا أرسله السيرفر) // تحديث الوقت المتبقي (إذا أرسله السيرفر)
if (data['eta_seconds'] != null) { if (data['eta_seconds'] != null) {

View File

@@ -45,7 +45,9 @@ class GoogleMapPassengerWidget extends StatelessWidget {
() async { () async {
controller.clearPolyline(); controller.clearPolyline();
// Ensure we have car data available before routing // Ensure we have car data available before routing
if (controller.dataCarsLocationByPassenger != null) { // if (controller.dataCarsLocationByPassenger != null) {
// i use this check if needed
if (controller.carsLocationByPassenger.isNotEmpty) {
await controller.getDirectionMap( await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${argument.latitude},${argument.longitude}', '${argument.latitude},${argument.longitude}',

View File

@@ -77,7 +77,8 @@ class _SearchingCaptainWindowState extends State<SearchingCaptainWindow>
child: OutlinedButton( child: OutlinedButton(
onPressed: () { onPressed: () {
// [تعديل 3] استدعاء دالة الإلغاء الموحدة // [تعديل 3] استدعاء دالة الإلغاء الموحدة
controller.cancelRide(); controller.changeCancelRidePageShow();
// ();
}, },
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
foregroundColor: AppColor.writeColor, foregroundColor: AppColor.writeColor,