This commit is contained in:
Hamza-Ayed
2024-10-03 22:25:44 +03:00
parent 79b14ab9cc
commit 8889780a6f
24 changed files with 853 additions and 734 deletions

View File

@@ -105,8 +105,8 @@ class MapDriverController extends GetxController {
late LatLng latLngPassengerDestination = LatLng(0, 0);
void onMapCreated(GoogleMapController controller) async {
myLocation = Get.find<LocationController>().location as LatLng;
myLocation = myLocation;
myLocation = Get.find<LocationController>().myLocation;
// myLocation = myLocation;
mapController = controller;
controller.getVisibleRegion();
controller.animateCamera(
@@ -454,9 +454,10 @@ class MapDriverController extends GetxController {
}
addWaitingTimeCostFromPassengerToDriverWallet() async {
double distance2 = calculateDistanceBetweenDriverAndPassengerLocation();
double distance2 =
await calculateDistanceBetweenDriverAndPassengerLocation();
if (distance2 > 40) {
if (distance2 > 60) {
Get.defaultDialog(
title: 'Your are far from passenger location'.tr,
middleText:
@@ -893,12 +894,11 @@ class MapDriverController extends GetxController {
void addCustomCarIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio
// scale: 1.0,
);
size: const Size(30, 35), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.asset(
config,
'assets/images/car.png',
// mipmaps: false,
).then((value) {
carIcon = value;
update();
@@ -999,11 +999,10 @@ class MapDriverController extends GetxController {
LatLng(bounds['southwest']['lat'], bounds['southwest']['lng']);
// Create the LatLngBounds object
LatLngBounds boundsData =
LatLngBounds(northeast: northeast, southwest: southwest);
boundsData = LatLngBounds(northeast: northeast, southwest: southwest);
// Fit the camera to the bounds
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 140);
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData!, 140);
mapController!.animateCamera(cameraUpdate);
update();
}