1/25/2
This commit is contained in:
@@ -1439,6 +1439,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
// getDistanceFromText(data[0]['distance']['text']);
|
||||
double distanceOfTrip = (data[0]['distance']['value']) / 1000;
|
||||
distance = distanceOfTrip;
|
||||
print('distance is $distanceOfTrip');
|
||||
// Animate the camera to the adjusted bounds
|
||||
if (distanceOfTrip <= 5) {
|
||||
@@ -1616,12 +1617,6 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
Future bottomSheet() async {
|
||||
if (data.isNotEmpty) {
|
||||
String distanceText = await data[0]['distance']['text'];
|
||||
// String durationText = await data[0]['duration']['text'];
|
||||
print(data[0]['duration']['text']);
|
||||
print('=================================');
|
||||
// distance = getDistanceFromText(distanceText);
|
||||
// duration = getDistanceFromText(durationText);
|
||||
durationToAdd = Duration(seconds: durationToRide);
|
||||
print('durationToRide----- $durationToRide');
|
||||
hours = durationToAdd.inHours;
|
||||
@@ -1637,61 +1632,37 @@ class MapPassengerController extends GetxController {
|
||||
totalME = totalPassenger - tax;
|
||||
update();
|
||||
if (currentTime.hour >= 22) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.23;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.23 / 1000;
|
||||
update();
|
||||
}
|
||||
cost = distance * 0.23;
|
||||
update();
|
||||
} else if (currentTime.hour < 5) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||
if (averageDuration > 2.5) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.25 / 1000;
|
||||
update();
|
||||
}
|
||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||
if (averageDuration > 2.5) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.25 / 1000;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.21 / 1000;
|
||||
update();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.21 / 1000;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
}
|
||||
|
||||
print('cost $cost');
|
||||
if (totalPassenger < 1) {
|
||||
totalPassenger = 1;
|
||||
totalDriver = 1;
|
||||
update();
|
||||
if (totalDriver < .5) {
|
||||
totalDriver = .75;
|
||||
totalME = .21;
|
||||
update();
|
||||
} else {
|
||||
totalDriver = .90;
|
||||
totalME = .06;
|
||||
update();
|
||||
}
|
||||
// if (totalDriver < .5) {
|
||||
// totalDriver = .75;
|
||||
// totalME = .21;
|
||||
// update();
|
||||
// } else {
|
||||
// totalDriver = .90;
|
||||
// totalME = .06;
|
||||
// update();
|
||||
// }
|
||||
}
|
||||
|
||||
// buttomSheetMapPage();
|
||||
|
||||
Reference in New Issue
Block a user