Update: 2026-07-12 18:53:59

This commit is contained in:
Hamza-Ayed
2026-07-12 18:53:59 +03:00
parent 8cd4a4b57e
commit 653d73422f
54 changed files with 2078 additions and 436 deletions
@@ -24,6 +24,7 @@ class MapSocketController extends GetxController {
// 🚌 مواصلاتي — الخط الحالي المشترَك فيه + مستمع تحديث موقع الباص
int? _subscribedTransitRouteId;
void Function(Map<String, dynamic> data)? onBusLocationUpdate;
void Function(String errorCode)? onTransitError;
DateTime? get lastDriverLocationTime => _lastSocketLocationTime;
int get socketLocationUpdatesCount => _socketLocationUpdatesCount;
@@ -154,6 +155,18 @@ class MapSocketController extends GetxController {
Log.print('Error parsing bus_location_update: $e');
}
});
socket.on('transit_error', (data) {
if (data == null) return;
try {
final map = Map<String, dynamic>.from(data as Map);
final code = map['code']?.toString() ?? '';
Log.print('⚠️ transit_error: $code');
onTransitError?.call(code);
} catch (e) {
Log.print('Error parsing transit_error: $e');
}
});
}
// ── مواصلاتي: اشتراك/إلغاء اشتراك ببثّ موقع خط ─────────────