8/11/1
This commit is contained in:
@@ -54,8 +54,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode = 83
|
versionCode = 84
|
||||||
versionName = '1.5.83'
|
versionName = '1.5.84'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ class LocationController extends GetxController {
|
|||||||
'longitude': myLocation.longitude.toString(),
|
'longitude': myLocation.longitude.toString(),
|
||||||
'heading': heading.toString(),
|
'heading': heading.toString(),
|
||||||
'speed': (speed * 3.6).toStringAsFixed(1),
|
'speed': (speed * 3.6).toStringAsFixed(1),
|
||||||
'distance': totalDistance == 0
|
'distance': totalDistance == 0 && (speed * 3.6) < 5
|
||||||
? '0.0'
|
? '0.0'
|
||||||
: totalDistance < 1
|
: totalDistance < 7
|
||||||
? totalDistance.toStringAsFixed(3)
|
? totalDistance.toStringAsFixed(3)
|
||||||
: totalDistance.toStringAsFixed(1),
|
: totalDistance.toStringAsFixed(1),
|
||||||
'status': box.read(BoxName.statusDriverLocation).toString(),
|
'status': box.read(BoxName.statusDriverLocation).toString(),
|
||||||
@@ -229,6 +229,10 @@ class LocationController extends GetxController {
|
|||||||
// Calculate the distance in kilometers
|
// Calculate the distance in kilometers
|
||||||
double distanceInKilometers = speedInKmPerHour * timeDifferenceInHours;
|
double distanceInKilometers = speedInKmPerHour * timeDifferenceInHours;
|
||||||
|
|
||||||
return distanceInKilometers;
|
// Convert distance from kilometers to meters
|
||||||
|
double distanceInMeters = distanceInKilometers * 1000;
|
||||||
|
|
||||||
|
// If the calculated distance is less than 6 meters, return 0 to avoid fake distance
|
||||||
|
return distanceInMeters < 5 ? 0 : distanceInKilometers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -694,166 +694,174 @@ class MapDriverController extends GetxController {
|
|||||||
durationOfRide = infinity;
|
durationOfRide = infinity;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
if (carType != 'Comfort' ||
|
// if (carType != 'Comfort' ||
|
||||||
carType != 'Mishwar Vip' ||
|
// carType != 'Mishwar Vip' ||
|
||||||
carType != 'Lady' ||
|
// carType != 'Lady' ||
|
||||||
carType != 'RayehGaiComfort') {
|
// carType != 'RayehGaiComfort') {
|
||||||
price = double.parse(totalCost);
|
price = double.parse(totalCost);
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
for (int i = 0; i <= durationOfRide; i++) {
|
for (int i = 0; i <= durationOfRide; i++) {
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
recentDistanceToDash = Get.find<LocationController>().totalDistance;
|
recentDistanceToDash = Get.find<LocationController>().totalDistance;
|
||||||
rideTimerFromBegin = i;
|
// rideTimerFromBegin = i;
|
||||||
|
if (int.parse(duration) > i) {
|
||||||
if (startNameLocation.toLowerCase().contains('airport') ||
|
price = double.parse(totalCost);
|
||||||
endNameLocation.toLowerCase().contains('airport') ||
|
} else {
|
||||||
startNameLocation.contains('مطار') ||
|
if (startNameLocation.toLowerCase().contains('airport') ||
|
||||||
startNameLocation.contains('المطار') ||
|
endNameLocation.toLowerCase().contains('airport') ||
|
||||||
endNameLocation.contains('مطار') ||
|
startNameLocation.contains('مطار') ||
|
||||||
endNameLocation.contains('المطار')) {
|
startNameLocation.contains('المطار') ||
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
endNameLocation.contains('مطار') ||
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
endNameLocation.contains('المطار')) {
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
|
|
||||||
// : carType == 'Speed'
|
|
||||||
// ? (i ~/ 60) +
|
|
||||||
// (recentDistanceToDash *
|
|
||||||
// Get.find<HomeCaptainController>().speedPrice)
|
|
||||||
: carType == 'Lady'
|
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
// : carType == 'Delivery'
|
|
||||||
// ? (i ~/ 60) +
|
|
||||||
// (recentDistanceToDash *
|
|
||||||
// Get.find<HomeCaptainController>().deliveryPrice)
|
|
||||||
: carType == 'RayehGaiComfort'
|
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
|
||||||
} else if (currentTime.hour >= 21 && currentTime.hour < 0) {
|
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
|
|
||||||
// : carType == 'Speed'
|
|
||||||
// ? (i ~/ 60) +
|
|
||||||
// (recentDistanceToDash *
|
|
||||||
// Get.find<HomeCaptainController>().speedPrice)
|
|
||||||
: carType == 'Lady'
|
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
// : carType == 'Delivery'
|
|
||||||
// ? (i ~/ 60) +
|
|
||||||
// (recentDistanceToDash *
|
|
||||||
// Get.find<HomeCaptainController>().deliveryPrice)
|
|
||||||
: carType == 'RayehGaiComfort'
|
|
||||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
|
||||||
20 +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
|
||||||
} else if (currentTime.hour >= 1 && currentTime.hour < 5) {
|
|
||||||
if (startNameLocation.contains('club') ||
|
|
||||||
startNameLocation.contains('nightclub') ||
|
|
||||||
startNameLocation.contains('ديسكو') ||
|
|
||||||
startNameLocation.contains('ملهى ليلي') ||
|
|
||||||
startNameLocation.contains('Night club')) {
|
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
? (i ~/ 60) *
|
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||||
(Get.find<HomeCaptainController>().latePrice + .5) *
|
(price) -
|
||||||
2 +
|
int.parse(duration) *
|
||||||
(recentDistanceToDash *
|
Get.find<HomeCaptainController>().latePrice
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
|
// : carType == 'Speed'
|
||||||
|
// ? (i ~/ 60) +
|
||||||
|
// (recentDistanceToDash *
|
||||||
|
// Get.find<HomeCaptainController>().speedPrice)
|
||||||
|
: carType == 'Lady'
|
||||||
|
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice
|
||||||
|
// : carType == 'Delivery'
|
||||||
|
// ? (i ~/ 60) +
|
||||||
|
// (recentDistanceToDash *
|
||||||
|
// Get.find<HomeCaptainController>().deliveryPrice)
|
||||||
|
: carType == 'RayehGaiComfort'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
|
: (i ~/ 60) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().mashwariPrice);
|
||||||
|
} else if (currentTime.hour >= 21 && currentTime.hour < 0) {
|
||||||
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
|
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice
|
||||||
|
|
||||||
|
// : carType == 'Speed'
|
||||||
|
// ? (i ~/ 60) +
|
||||||
|
// (recentDistanceToDash *
|
||||||
|
// Get.find<HomeCaptainController>().speedPrice)
|
||||||
|
: carType == 'Lady'
|
||||||
|
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice
|
||||||
|
// : carType == 'Delivery'
|
||||||
|
// ? (i ~/ 60) +
|
||||||
|
// (recentDistanceToDash *
|
||||||
|
// Get.find<HomeCaptainController>().deliveryPrice)
|
||||||
|
: carType == 'RayehGaiComfort'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
|
: (i ~/ 60) *
|
||||||
|
Get.find<HomeCaptainController>().latePrice +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().mashwariPrice);
|
||||||
|
} else if (currentTime.hour >= 1 && currentTime.hour < 5) {
|
||||||
|
if (startNameLocation.contains('club') ||
|
||||||
|
startNameLocation.contains('nightclub') ||
|
||||||
|
startNameLocation.contains('ديسكو') ||
|
||||||
|
startNameLocation.contains('ملهى ليلي') ||
|
||||||
|
startNameLocation.contains('Night club')) {
|
||||||
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||||
|
2 +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||||
|
2
|
||||||
|
: carType == 'Lady'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||||
|
2 +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||||
|
2
|
||||||
|
: carType == 'RayehGaiComfort'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice +
|
||||||
|
.5) *
|
||||||
|
2 +
|
||||||
|
(price)
|
||||||
|
: (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice +
|
||||||
|
.5) *
|
||||||
|
2 +
|
||||||
|
(price);
|
||||||
|
}
|
||||||
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
|
? (i ~/ 60) * (Get.find<HomeCaptainController>().latePrice + .5) +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
(Get.find<HomeCaptainController>().latePrice + .5)
|
||||||
: carType == 'Lady'
|
: carType == 'Lady'
|
||||||
? (i ~/ 60) *
|
? (i ~/ 60) *
|
||||||
(Get.find<HomeCaptainController>().latePrice + .5) *
|
(Get.find<HomeCaptainController>().latePrice + .5) +
|
||||||
2 +
|
(price) -
|
||||||
(recentDistanceToDash *
|
int.parse(duration) *
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
(Get.find<HomeCaptainController>().latePrice + .5)
|
||||||
: carType == 'RayehGaiComfort'
|
: carType == 'RayehGaiComfort'
|
||||||
? (i ~/ 60) *
|
? (i ~/ 60) *
|
||||||
(Get.find<HomeCaptainController>().latePrice +
|
(Get.find<HomeCaptainController>().latePrice +
|
||||||
.5) *
|
.5) +
|
||||||
2 +
|
|
||||||
(recentDistanceToDash *
|
(recentDistanceToDash *
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
: (i ~/ 60) *
|
: (i ~/ 60) *
|
||||||
(Get.find<HomeCaptainController>().latePrice +
|
(Get.find<HomeCaptainController>().latePrice +
|
||||||
.5) *
|
.5) +
|
||||||
2 +
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().mashwariPrice);
|
||||||
|
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
|
||||||
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
|
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
(Get.find<HomeCaptainController>().heavyPrice + .5)
|
||||||
|
: carType == 'Lady'
|
||||||
|
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
||||||
|
(price) -
|
||||||
|
int.parse(duration) *
|
||||||
|
(Get.find<HomeCaptainController>().heavyPrice + .5)
|
||||||
|
: carType == 'RayehGaiComfort'
|
||||||
|
? (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().heavyPrice) +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
|
: (i ~/ 60) *
|
||||||
|
(Get.find<HomeCaptainController>().heavyPrice) +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().mashwariPrice);
|
||||||
|
} else {
|
||||||
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
|
? (i ~/ 60) + (price) - int.parse(duration)
|
||||||
|
: carType == 'Lady'
|
||||||
|
? (i ~/ 60) + (price) - int.parse(duration)
|
||||||
|
: carType == 'RayehGaiComfort'
|
||||||
|
? (i ~/ 60) +
|
||||||
|
(recentDistanceToDash *
|
||||||
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
|
: (i ~/ 60) +
|
||||||
(recentDistanceToDash *
|
(recentDistanceToDash *
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
Get.find<HomeCaptainController>().mashwariPrice);
|
||||||
}
|
}
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
|
||||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().latePrice + .5) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'Lady'
|
|
||||||
? (i ~/ 60) *
|
|
||||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'RayehGaiComfort'
|
|
||||||
? (i ~/ 60) *
|
|
||||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: (i ~/ 60) *
|
|
||||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
|
||||||
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
|
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
|
||||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'Lady'
|
|
||||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'RayehGaiComfort'
|
|
||||||
? (i ~/ 60) *
|
|
||||||
(Get.find<HomeCaptainController>().heavyPrice) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: (i ~/ 60) *
|
|
||||||
(Get.find<HomeCaptainController>().heavyPrice) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
|
||||||
} else {
|
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
|
||||||
? (i ~/ 60) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'Lady'
|
|
||||||
? (i ~/ 60) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: carType == 'RayehGaiComfort'
|
|
||||||
? (i ~/ 60) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
|
||||||
: (i ~/ 60) +
|
|
||||||
(recentDistanceToDash *
|
|
||||||
Get.find<HomeCaptainController>().mashwariPrice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// $1 for each minute + $4 for each km
|
// $1 for each minute + $4 for each km
|
||||||
price = (price * double.parse(kazan)) + price; // Add 10% tax
|
price = (price * double.parse(kazan)) + price; // Add 10% tax
|
||||||
speed = Get.find<LocationController>().speed * 3.6;
|
speed = Get.find<LocationController>().speed * 3.6;
|
||||||
|
|||||||
Reference in New Issue
Block a user