This commit is contained in:
Hamza Aleghwairyeen
2024-04-02 23:03:14 +03:00
parent e822f8c552
commit 682da605c5
5 changed files with 22 additions and 21 deletions

View File

@@ -104,14 +104,14 @@ class MapDriverController extends GetxController {
myLocation = myLocation;
mapController = controller;
controller.getVisibleRegion();
controller.animateCamera(
CameraUpdate.newLatLng(myLocation),
);
update();
// Set up a timer or interval to trigger the marker update every 3 seconds.
timer = Timer.periodic(const Duration(seconds: 1), (_) {
updateMarker();
controller.animateCamera(
CameraUpdate.newLatLng(myLocation),
);
update();
});
}
@@ -534,7 +534,7 @@ class MapDriverController extends GetxController {
// Get.back();
}
void cancelCheckRidefromPassenger() async {
void cancelCheckRideFromPassenger() async {
var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: {
'order_id': rideId,
}); //.then((value) {
@@ -626,7 +626,7 @@ class MapDriverController extends GetxController {
markers.add(
Marker(
markerId: MarkerId('MyLocation'.tr),
position: locationController.myLocation,
position: myLocation,
draggable: true,
icon: carIcon,
rotation: locationController.heading,
@@ -637,7 +637,7 @@ class MapDriverController extends GetxController {
);
mapController!.animateCamera(
CameraUpdate.newLatLng(locationController.myLocation),
CameraUpdate.newLatLng(myLocation),
);
update();
}

View File

@@ -627,6 +627,7 @@ class MapPassengerController extends GetxController {
update();
// isCancelRidePageShown = true;
rideIsBeginPassengerTimer();
runWhenRideIsBegin();
// //print('rideTimerBegin: $rideTimerBegin');
}
} catch (e) {
@@ -670,7 +671,7 @@ class MapPassengerController extends GetxController {
// isCancelRidePageShown = true;
update();
rideIsBeginPassengerTimer();
runWhenRideIsBegin();
// runWhenRideIsBegin();
}
void cancelTimerToPassengerFromDriverAfterApplied() {
@@ -1658,7 +1659,7 @@ class MapPassengerController extends GetxController {
// });
// }
Future startMarkerReloading() async {
startMarkerReloading() async {
int reloadCount = 0;
Timer.periodic(const Duration(seconds: 2), (timer) {
@@ -2344,7 +2345,7 @@ class MapPassengerController extends GetxController {
await getLocation();
await addToken();
await getKazanPercent();
await startMarkerReloading();
startMarkerReloading();
// await getCarsLocationByPassenger();
// await getNearestDriverByPassengerLocation();
addCustomPicker();