Update: 2026-07-12 18:53:59
This commit is contained in:
@@ -297,30 +297,19 @@ class LocationSearchController extends GetxController {
|
||||
newMyLocation = passengerLocation;
|
||||
|
||||
if (!CountryPolygons.isServiceSupported(passengerLocation)) {
|
||||
Get.bottomSheet(
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.location_off, size: 60, color: Colors.redAccent),
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
'service_unavailable_area'.tr,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
isDismissible: false,
|
||||
enableDrag: false,
|
||||
);
|
||||
if (!Get.isSnackbarOpen) {
|
||||
Get.snackbar(
|
||||
'Alert'.tr,
|
||||
'service_unavailable_area'.tr,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.redAccent,
|
||||
colorText: Colors.white,
|
||||
icon: const Icon(Icons.location_off, color: Colors.white),
|
||||
margin: const EdgeInsets.all(15),
|
||||
duration: const Duration(seconds: 5),
|
||||
isDismissible: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Get.isRegistered<RideLifecycleController>()) {
|
||||
|
||||
@@ -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