Update: 2026-07-13 18:23:52
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:intaleq_maps/intaleq_maps.dart' show LatLng;
|
||||
|
||||
import '../functions/location_controller.dart';
|
||||
import '../widgets/error_snakbar.dart';
|
||||
import 'transit_driver_models.dart';
|
||||
import 'transit_driver_service.dart';
|
||||
|
||||
@@ -117,7 +118,7 @@ class TransitDriverController extends GetxController {
|
||||
}
|
||||
await fetchTodayTrips();
|
||||
} else {
|
||||
Get.snackbar('مواصلاتي', res.message);
|
||||
mySnackbarError(res.message);
|
||||
}
|
||||
|
||||
isActionInProgress = false;
|
||||
@@ -139,7 +140,7 @@ class TransitDriverController extends GetxController {
|
||||
}
|
||||
await fetchTodayTrips();
|
||||
} else {
|
||||
Get.snackbar('مواصلاتي', res.message);
|
||||
mySnackbarError(res.message);
|
||||
}
|
||||
|
||||
isActionInProgress = false;
|
||||
@@ -154,10 +155,23 @@ class TransitDriverController extends GetxController {
|
||||
delayMinutes: minutes,
|
||||
reason: reason,
|
||||
);
|
||||
if (!res.success) Get.snackbar('مواصلاتي', res.message);
|
||||
if (!res.success) mySnackbarError(res.message);
|
||||
return res.success;
|
||||
}
|
||||
|
||||
Future<bool> boardPassenger(int stopId, String passengerId) async {
|
||||
final res = await TransitDriverService.boardPassenger(stopId, passengerId);
|
||||
return res.success;
|
||||
}
|
||||
|
||||
Future<List<Map<String, dynamic>>> getStopPassengers(int stopId) async {
|
||||
final res = await TransitDriverService.getStopPassengers(stopId);
|
||||
if (res.success && res.data != null) {
|
||||
return res.data!;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
// ── كشف الوصول للمحطات (جيوفينس) ────────────────────────────
|
||||
// تُستدعى من LocationController عند كل تحديث للموقع أثناء وضع الباص
|
||||
void onLocationUpdate(LatLng pos) {
|
||||
|
||||
Reference in New Issue
Block a user