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