This commit is contained in:
Hamza-Ayed
2024-05-10 16:04:47 +03:00
parent 1e37b6dceb
commit d5d9ddd2cb
2 changed files with 11 additions and 33 deletions

View File

@@ -2387,12 +2387,11 @@ class MapPassengerController extends GetxController {
print('costDistance----- $costDistance'); print('costDistance----- $costDistance');
print( print(
'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}'); 'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}');
double costComfort, costSpeed, costDelivery, costMashwari, costLady = 0; double costComfort, costSpeed, costDelivery, costLady = 0;
update(); update();
if (currentTime.hour >= 22 && currentTime.hour < 5) { if (currentTime.hour >= 22 && currentTime.hour < 5) {
// costDistance = distance * latePrice; // costDistance = distance * latePrice;
costComfort = (distance * comfortPrice) + costDuration * latePrice; costComfort = (distance * comfortPrice) + costDuration * latePrice;
costMashwari = (distance * mashwariPrice) + costDuration * latePrice;
costSpeed = (distance * speedPrice) + costDuration * latePrice; costSpeed = (distance * speedPrice) + costDuration * latePrice;
costDelivery = (distance * deliveryPrice) + costDuration * latePrice; costDelivery = (distance * deliveryPrice) + costDuration * latePrice;
costLady = (distance * comfortPrice + 2) + costDuration * latePrice; costLady = (distance * comfortPrice + 2) + costDuration * latePrice;
@@ -2402,7 +2401,6 @@ class MapPassengerController extends GetxController {
// if (averageDuration > 2.5) { // if (averageDuration > 2.5) {
// costDistance = distance * heavyPrice; // costDistance = distance * heavyPrice;
costComfort = (distance * comfortPrice) + costDuration * heavyPrice; costComfort = (distance * comfortPrice) + costDuration * heavyPrice;
costMashwari = (distance * mashwariPrice) + costDuration * heavyPrice;
costSpeed = (distance * speedPrice) + costDuration * heavyPrice; costSpeed = (distance * speedPrice) + costDuration * heavyPrice;
costDelivery = (distance * deliveryPrice) + costDuration * heavyPrice; costDelivery = (distance * deliveryPrice) + costDuration * heavyPrice;
costLady = (distance * comfortPrice + 2) + costDuration * heavyPrice; costLady = (distance * comfortPrice + 2) + costDuration * heavyPrice;
@@ -2412,7 +2410,6 @@ class MapPassengerController extends GetxController {
} else { } else {
// costDistance = distance * (naturePrice - .1); // costDistance = distance * (naturePrice - .1);
costComfort = (distance * comfortPrice) + costDuration; costComfort = (distance * comfortPrice) + costDuration;
costMashwari = (distance * mashwariPrice) + costDuration;
costSpeed = (distance * speedPrice) + costDuration; costSpeed = (distance * speedPrice) + costDuration;
costDelivery = (distance * deliveryPrice) + costDuration; costDelivery = (distance * deliveryPrice) + costDuration;
costLady = (distance * comfortPrice + 2) + costDuration; costLady = (distance * comfortPrice + 2) + costDuration;
@@ -2470,6 +2467,8 @@ class MapPassengerController extends GetxController {
// buttomSheetMapPage(); // buttomSheetMapPage();
changeBottomSheetShown(); changeBottomSheetShown();
} else {
print('==========================');
} }
} }
@@ -2609,6 +2608,7 @@ class MapPassengerController extends GetxController {
await getRideStatusFromStartApp(); await getRideStatusFromStartApp();
startMarkerReloading(); startMarkerReloading();
Get.put(TextToSpeechController()); Get.put(TextToSpeechController());
box.write(BoxName.carType, 'yet');
// await getNearestDriverByPassengerLocation(); // await getNearestDriverByPassengerLocation();
initilizeGetStorage(); initilizeGetStorage();

View File

@@ -95,7 +95,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () async {
if (box.read(BoxName.addWork) == 'addWork') { if (box.read(BoxName.addWork) == 'addWork') {
controller.workLocationFromMap = true; controller.workLocationFromMap = true;
controller.changeMainBottomMenuMap(); controller.changeMainBottomMenuMap();
@@ -114,23 +114,10 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.newStartPointLocation; controller.newStartPointLocation;
controller.changeMainBottomMenuMap(); controller.changeMainBottomMenuMap();
controller.getMap( await controller.getMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${latLng.latitude},${latLng.longitude}', '${latLng.latitude},${latLng.longitude}',
); );
// controller.currentLocationToFormPlaces = false;
// controller.placesDestination = [];
// // controller.isCancelRidePageShown = true;
// controller.clearPlacesStart();
// controller.clearPlacesDestination();
// controller.passengerStartLocationFromMap =
// false;
// controller.isPickerShown = false;
// controller.bottomSheet();
// controller.showBottomSheet1();
// controller.update();
controller.currentLocationToFormPlaces = false; controller.currentLocationToFormPlaces = false;
controller.placesDestination = []; controller.placesDestination = [];
// controller.isCancelRidePageShown = true; // controller.isCancelRidePageShown = true;
@@ -139,17 +126,8 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.passengerStartLocationFromMap = controller.passengerStartLocationFromMap =
false; false;
controller.isPickerShown = false; controller.isPickerShown = false;
// controller.showBottomSheet1(); controller.bottomSheet();
// Get.back();
controller.showBottomSheet1(); controller.showBottomSheet1();
controller.placesDestination = [];
controller.placeDestinationController.clear();
controller.showBottomSheet1();
// Get.back();
// controller.showBottomSheet1();
controller.changeMainBottomMenuMap();
} }
}, },
onLongPress: () { onLongPress: () {
@@ -172,8 +150,8 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
border: Border.all()), border: Border.all()),
child: Text( child: Text(
' ${box.read(BoxName.addWork)}' == 'addWork' ' ${box.read(BoxName.addWork)}' == 'addWork'
? 'Add Work' ? 'Add Work'.tr
: 'Work', : 'Work'.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@@ -193,7 +171,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.changePickerShown(); controller.changePickerShown();
})); }));
}, },
onTap: () { onTap: () async {
if (box.read(BoxName.addHome) == 'addHome') { if (box.read(BoxName.addHome) == 'addHome') {
controller.homeLocationFromMap = true; controller.homeLocationFromMap = true;
controller.changeMainBottomMenuMap(); controller.changeMainBottomMenuMap();
@@ -211,7 +189,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.changeMainBottomMenuMap(); controller.changeMainBottomMenuMap();
// controller.newMyLocation = latLng; // controller.newMyLocation = latLng;
controller.getMap( await controller.getMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}', '${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${latLng.latitude},${latLng.longitude}', '${latLng.latitude},${latLng.longitude}',
); );