This commit is contained in:
Hamza Aleghwairyeen
2024-04-03 02:09:22 +03:00
parent 087b102d9a
commit aee7809bde
3 changed files with 13 additions and 13 deletions

View File

@@ -56,14 +56,14 @@ class LocationController extends GetxController {
await getLocation(); await getLocation();
// Animate camera to user location (optional) // Animate camera to user location (optional)
if (Get.find<HomeCaptainController>().rideId == 'rideId') { // if (Get.find<HomeCaptainController>().rideId == 'rideId') {
Get.find<MapDriverController>() // Get.find<MapDriverController>()
.mapController! // .mapController!
.animateCamera(CameraUpdate.newLatLng(LatLng( // .animateCamera(CameraUpdate.newLatLng(LatLng(
Get.find<LocationController>().myLocation.latitude, // Get.find<LocationController>().myLocation.latitude,
Get.find<LocationController>().myLocation.longitude, // Get.find<LocationController>().myLocation.longitude,
))); // )));
} // }
Get.find<HomeCaptainController>() Get.find<HomeCaptainController>()
.mapHomeCaptainController .mapHomeCaptainController
.animateCamera(CameraUpdate.newLatLng(LatLng( .animateCamera(CameraUpdate.newLatLng(LatLng(

View File

@@ -105,9 +105,9 @@ class MapDriverController extends GetxController {
myLocation = myLocation; myLocation = myLocation;
mapController = controller; mapController = controller;
controller.getVisibleRegion(); controller.getVisibleRegion();
controller.animateCamera( // controller.animateCamera(
CameraUpdate.newLatLng(Get.find<LocationController>().myLocation), // CameraUpdate.newLatLng(Get.find<LocationController>().myLocation),
); // );
// Set up a timer or interval to trigger the marker update every 3 seconds. // Set up a timer or interval to trigger the marker update every 3 seconds.
// timer = Timer.periodic(const Duration(seconds: 1), (_) { // timer = Timer.periodic(const Duration(seconds: 1), (_) {
// updateMarker(); // updateMarker();
@@ -895,7 +895,7 @@ class MapDriverController extends GetxController {
addCustomStartIcon(); addCustomStartIcon();
addCustomEndIcon(); addCustomEndIcon();
// updateMarker(); // updateMarker();
updateLocation(); // updateLocation();
startTimerToShowPassengerInfoWindowFromDriver(); startTimerToShowPassengerInfoWindowFromDriver();
durationToAdd = Duration(seconds: int.parse(duration)); durationToAdd = Duration(seconds: int.parse(duration));
hours = durationToAdd.inHours; hours = durationToAdd.inHours;

View File

@@ -23,7 +23,7 @@ class PassengerLocationMapPage extends StatelessWidget {
// Get.put(MapDriverController()); // Get.put(MapDriverController());
return MyScafolld( return MyScafolld(
title: 'Map Passenger'.tr + mapDriverController.carType, title: 'Map Passenger'.tr,
body: [ body: [
GoogleDriverMap(locationController: locationController), GoogleDriverMap(locationController: locationController),
const PassengerInfoWindow(), const PassengerInfoWindow(),