This commit is contained in:
Hamza Aleghwairyeen
2024-04-01 03:41:04 +03:00
parent 398c3c8f9d
commit b710fe314e
8 changed files with 252 additions and 119 deletions

View File

@@ -97,14 +97,14 @@ class OrderRequestController extends GetxController {
update();
}
if (remainingTimeSpeed == 0) {
if (applied == false) {
print('applied=========================');
print(applied);
Get.back();
// refuseOrder(box.read(BoxName.driverID), orderID);
}
}
// if (remainingTimeSpeed == 0) {
// if (applied == false) {
// print('applied=========================');
// print(applied);
// Get.back();
// // refuseOrder(box.read(BoxName.driverID), orderID);
// }
// }
}
void refuseOrder(orderID) async {

View File

@@ -471,7 +471,7 @@ class MapPassengerController extends GetxController {
// Format the message.
String message =
'${'${'Hi! This is'.tr} ${box.read(BoxName.name)}.\n${' I am using'.tr}'} ${box.read(AppInformation.appName)}${' to ride with'.tr} $firstName${' as the driver.'.tr} $firstName \n${'is driving a '.tr}$model\n${' with license plate '.tr}$licensePlate.\n${' I am currently located at '.tr}$passengerLocation.\n${' If you need to reach me, please contact the driver directly at'.tr}\n\n $driverPhone.';
'${'${'Hi! This is'.tr} ${box.read(BoxName.name)}.\n${' I am using'.tr}'} ${AppInformation.appName}${' to ride with'.tr} $firstName${' as the driver.'.tr} $firstName \n${'is driving a '.tr}$model\n${' with license plate '.tr}$licensePlate.\n${' I am currently located at '.tr} https://www.google.com/maps/place/${passengerLocation.latitude},${passengerLocation.longitude}.\n${' If you need to reach me, please contact the driver directly at'.tr}\n\n $driverPhone.';
// Launch the URL to send the SMS.
launchCommunication('whatsapp', to, message);
@@ -1199,18 +1199,16 @@ class MapPassengerController extends GetxController {
}
void reloadMarkerDriverCarsLocationToPassengerAfterApplied() {
// Clear existing markers
// markers.clear();
// update();
clearMarkersExceptStartEnd();
// for (var i = 0; i < driverCarsLocationToPassengerAfterApplied.length; i++) {
LatLng driverPosition = LatLng(
double.parse(
datadriverCarsLocationToPassengerAfterApplied[0]['latitude']),
double.parse(
datadriverCarsLocationToPassengerAfterApplied[0]['longitude']));
final driverAcceptedMarker = Marker(
markerId: const MarkerId('driverToPassengers'),
position: LatLng(
double.parse(
datadriverCarsLocationToPassengerAfterApplied[0]['latitude']),
double.parse(
datadriverCarsLocationToPassengerAfterApplied[0]['longitude'])),
position: driverPosition,
rotation: double.parse(
datadriverCarsLocationToPassengerAfterApplied['message'][0]
['heading']),
@@ -1218,9 +1216,7 @@ class MapPassengerController extends GetxController {
);
markers.add(driverAcceptedMarker);
// update();
mapController?.animateCamera(CameraUpdate.newLatLng(LatLng(
driverCarsLocationToPassengerAfterApplied[0].latitude,
driverCarsLocationToPassengerAfterApplied[0].longitude)));
mapController?.animateCamera(CameraUpdate.newLatLng(driverPosition));
update();
// } // Update the map with the new markers
}