Update: 2026-07-12 18:53:59
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ── مواصلاتي: اشتراك/إلغاء اشتراك ببثّ موقع خط ─────────────
|
||||
|
||||
Reference in New Issue
Block a user