This commit is contained in:
Hamza-Ayed
2024-09-15 09:53:40 +03:00
parent e23709c924
commit 9752d61230
24 changed files with 9002 additions and 221 deletions

View File

@@ -233,7 +233,7 @@ class MapPassengerController extends GetxController {
late double totalPassengerSpeedDiscount = 0;
late double totalPassengerBalashDiscount = 0;
late double totalPassengerRaihGaiDiscount = 0;
late double totalPassengerMotoDelivery = 0;
late double totalPassengerScooter = 0;
late double totalDriver = 0;
late double averageDuration = 0;
late double costDuration = 0;
@@ -3269,6 +3269,8 @@ class MapPassengerController extends GetxController {
double totalPassengerBalash = 0;
double totalPassengerLady = 0;
double totalPassengerRayehGai = 0;
double totalPassengerRayehGaiComfort = 0;
double totalPassengerRayehGaiBalash = 0;
Future bottomSheet() async {
if (data.isNotEmpty) {
durationToAdd = Duration(seconds: durationToRide);
@@ -3285,9 +3287,40 @@ class MapPassengerController extends GetxController {
costDelivery,
costBalash,
costLady,
costRayehGai = 0;
costRayehGai,
costRayehGaiBalash,
costRayehGaiComfort = 0;
update();
if (currentTime.hour >= 22 && currentTime.hour < 5) {
if (startNameAddress.toLowerCase().contains('airport') ||
endNameAddress.toLowerCase().contains('airport') ||
startNameAddress.contains('مطار') ||
startNameAddress.contains('المطار') ||
endNameAddress.contains('مطار') ||
endNameAddress.contains('المطار')) {
costComfort =
(distance * comfortPrice) + (costDuration * latePrice) + 20;
costSpeed = (distance * speedPrice) + (costDuration * latePrice) + 20;
costBalash =
(distance * (speedPrice - 1)) + (costDuration * latePrice) + 20;
costDelivery =
(distance * deliveryPrice) + (costDuration * latePrice) + 20;
costLady =
(distance * comfortPrice + 2) + (costDuration * latePrice) + 20;
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice +
20;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice +
20;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice +
20;
update();
} else if (currentTime.hour >= 21 && currentTime.hour < 0) {
// costDistance = distance * latePrice;
costComfort = (distance * comfortPrice) + costDuration * latePrice;
costSpeed = (distance * speedPrice) + costDuration * latePrice;
@@ -3297,9 +3330,65 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice;
update();
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
} else if (currentTime.hour >= 1 && currentTime.hour < 5) {
// costDistance = distance * latePrice;
if (startNameAddress.contains('club') ||
startNameAddress.contains('nightclub') ||
startNameAddress.contains('ديسكو') ||
startNameAddress.contains('ملهى ليلي') ||
startNameAddress.contains('Night club')) {
// Your code here
costComfort =
(distance * comfortPrice) + costDuration * (latePrice + .5) * 2;
costSpeed =
(distance * speedPrice) + costDuration * (latePrice + .5) * 2;
costBalash = (distance * (speedPrice - 1)) +
costDuration * (latePrice + .5) * 2;
costDelivery =
(distance * deliveryPrice) + costDuration * (latePrice + .5) * 2;
costLady = (distance * comfortPrice + 2) +
costDuration * (latePrice + .5) * 2;
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
update();
}
costComfort =
(distance * comfortPrice) + costDuration * (latePrice + .5);
costSpeed = (distance * speedPrice) + costDuration * (latePrice + .5);
costBalash =
(distance * (speedPrice - 1)) + costDuration * (latePrice + .5);
costDelivery =
(distance * deliveryPrice) + costDuration * (latePrice + .5);
costLady =
(distance * comfortPrice + 2) + costDuration * (latePrice + .5);
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice;
update();
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
// if (averageDuration > 2.5) {
// costDistance = distance * heavyPrice;
costComfort = (distance * comfortPrice) + costDuration * heavyPrice;
@@ -3310,6 +3399,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * heavyPrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * heavyPrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * heavyPrice;
update();
// } /
@@ -3323,6 +3418,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2;
update();
}
@@ -3338,6 +3439,12 @@ class MapPassengerController extends GetxController {
(costBalash + (costBalash * kazan / 100)).ceilToDouble();
totalPassengerRayehGai =
(costRayehGai + (costRayehGai * kazan / 100)).ceilToDouble();
totalPassengerRayehGaiComfort =
(costRayehGaiComfort + (costRayehGaiComfort * kazan / 100))
.ceilToDouble();
totalPassengerRayehGaiBalash =
(costRayehGaiBalash + (costRayehGaiBalash * kazan / 100))
.ceilToDouble();
totalPassengerComfortDiscount =
totalPassengerComfort + totalPassengerComfort * (kazan - 0) / 100;
totalPassengerLadyDiscount =
@@ -3348,7 +3455,7 @@ class MapPassengerController extends GetxController {
totalPassengerBalash + totalPassengerBalash * (kazan) / 100;
totalPassengerRaihGaiDiscount =
totalPassengerRayehGai + totalPassengerRayehGai * (kazan) / 100;
totalPassengerMotoDelivery =
totalPassengerScooter =
(costDelivery + (costDelivery * kazan / 100)).ceilToDouble();
totalPassengerComfort = totalPassengerComfortDiscount -
(totalPassengerComfortDiscount * kazan / 100);
@@ -3369,7 +3476,7 @@ class MapPassengerController extends GetxController {
totalPassengerBalash = 20;
totalPassengerComfort = 30;
totalPassengerLady = 30;
totalPassengerMotoDelivery = 18;
totalPassengerScooter = 18;
} else {
totalPassenger = totalCostPassenger;
update();
@@ -3383,7 +3490,9 @@ class MapPassengerController extends GetxController {
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerBalash = totalPassengerBalash +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerMotoDelivery = totalPassengerMotoDelivery +
totalPassengerScooter = totalPassengerScooter +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerRayehGai = totalPassengerScooter +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
update();
}
@@ -3620,7 +3729,7 @@ class MapPassengerController extends GetxController {
addCustomStepIcon();
addCustomStartIcon();
addCustomEndIcon();
await getLocation();
getLocation();
// await addToken();
getKazanPercent();