4/1/3
This commit is contained in:
@@ -132,7 +132,7 @@ class AppLink {
|
|||||||
// =====================================
|
// =====================================
|
||||||
static String addRateToPassenger = "$ride/rate/add.php";
|
static String addRateToPassenger = "$ride/rate/add.php";
|
||||||
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
||||||
static String getDriverRate = "$ride/rate/getDriveRrate.php";
|
static String getDriverRate = "$ride/rate/getDriverRate.php";
|
||||||
|
|
||||||
////////////////emails ============//
|
////////////////emails ============//
|
||||||
static String sendEmailToPassengerForTripDetails =
|
static String sendEmailToPassengerForTripDetails =
|
||||||
|
|||||||
@@ -206,9 +206,9 @@ class HomeCaptainController extends GetxController {
|
|||||||
await addToken();
|
await addToken();
|
||||||
await getlocation();
|
await getlocation();
|
||||||
onButtonSelected();
|
onButtonSelected();
|
||||||
await getPaymentToday();
|
|
||||||
await getDriverRate();
|
await getDriverRate();
|
||||||
getKazanPercent();
|
await getKazanPercent();
|
||||||
|
await getPaymentToday();
|
||||||
getCountRideToday();
|
getCountRideToday();
|
||||||
getAllPayment();
|
getAllPayment();
|
||||||
startPeriodicExecution();
|
startPeriodicExecution();
|
||||||
@@ -269,9 +269,10 @@ class HomeCaptainController extends GetxController {
|
|||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
link: AppLink.getDriverRate,
|
link: AppLink.getDriverRate,
|
||||||
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
||||||
data = jsonDecode(res);
|
var decod = jsonDecode(res);
|
||||||
|
// print(decod);
|
||||||
rating = data['message'][0]['rating'].toString();
|
rating = decod['message'][0]['rating'].toString();
|
||||||
|
// print('rating $rating');
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -501,8 +501,10 @@ update ui for totla results
|
|||||||
isRideFinished = true;
|
isRideFinished = true;
|
||||||
isRideStarted = false;
|
isRideStarted = false;
|
||||||
isPriceWindow = false;
|
isPriceWindow = false;
|
||||||
if (cartype == 'Comfort') {
|
if (cartype == 'Comfort' || cartype == 'Free Ride') {
|
||||||
totalCost = price.toStringAsFixed(2);
|
totalCost = price.toStringAsFixed(2);
|
||||||
|
paymentAmount = totalCost;
|
||||||
|
// update();
|
||||||
}
|
}
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
// changeRideToBeginToPassenger();
|
// changeRideToBeginToPassenger();
|
||||||
@@ -600,7 +602,7 @@ update ui for totla results
|
|||||||
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;
|
||||||
price = cartype == 'Comfort'
|
price = cartype == 'Comfort' || cartype == 'Free Ride'
|
||||||
? (i ~/ 60) +
|
? (i ~/ 60) +
|
||||||
(recentDistanceToDash *
|
(recentDistanceToDash *
|
||||||
Get.find<HomeCaptainController>().comfortPrice)
|
Get.find<HomeCaptainController>().comfortPrice)
|
||||||
|
|||||||
@@ -598,21 +598,7 @@ class MapPassengerController extends GetxController {
|
|||||||
rideTimerBegin = false;
|
rideTimerBegin = false;
|
||||||
isRideFinished = true;
|
isRideFinished = true;
|
||||||
update();
|
update();
|
||||||
//print('rideTimerBegin: $rideTimerBegin');
|
|
||||||
//print('isRideFinished: $isRideFinished');
|
|
||||||
// if (Get.find<PaymentController>().isWalletChecked == true &&
|
|
||||||
// Get.find<PaymentController>().isCashChecked == false) {
|
|
||||||
// if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
|
||||||
// totalPassenger = totalCostPassenger +
|
|
||||||
// double.parse(box.read(BoxName.passengerWalletTotal));
|
|
||||||
// } else {
|
|
||||||
// totalPassenger = totalCostPassenger + 0;
|
|
||||||
// }
|
|
||||||
// await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
|
||||||
// 'passenger_id': box.read(BoxName.passengerID).toString(),
|
|
||||||
// 'balance': ((-1) * totalPassenger).toString()
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tripFinishedFromDriver() async {
|
void tripFinishedFromDriver() async {
|
||||||
@@ -684,7 +670,7 @@ class MapPassengerController extends GetxController {
|
|||||||
remainingTime = 0;
|
remainingTime = 0;
|
||||||
// isCancelRidePageShown = true;
|
// isCancelRidePageShown = true;
|
||||||
update();
|
update();
|
||||||
rideIsBeginPassengerTimer();
|
rideIsBeginPassengerTimer();runWhenRideIsBegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelTimerToPassengerFromDriverAfterApplied() {
|
void cancelTimerToPassengerFromDriverAfterApplied() {
|
||||||
@@ -1174,7 +1160,20 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
Future runEvery30SecondsUntilConditionMet() async {
|
Future runEvery30SecondsUntilConditionMet() async {
|
||||||
// Calculate the duration of the trip in minutes.
|
// Calculate the duration of the trip in minutes.
|
||||||
double tripDurationInMinutes = durationToPassenger / 4;
|
double tripDurationInMinutes = durationToPassenger / 6;
|
||||||
|
int loopCount = tripDurationInMinutes.ceil();
|
||||||
|
// If the trip duration is less than or equal to 50 minutes, then break the loop.
|
||||||
|
for (var i = 0; i < loopCount; i++) {
|
||||||
|
// Wait for 50 seconds.
|
||||||
|
await Future.delayed(const Duration(seconds: 4));
|
||||||
|
await getDriverCarsLocationToPassengerAfterApplied();
|
||||||
|
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future runWhenRideIsBegin() async {
|
||||||
|
// Calculate the duration of the trip in minutes.
|
||||||
|
double tripDurationInMinutes = durationToRide / 6;
|
||||||
int loopCount = tripDurationInMinutes.ceil();
|
int loopCount = tripDurationInMinutes.ceil();
|
||||||
// If the trip duration is less than or equal to 50 minutes, then break the loop.
|
// If the trip duration is less than or equal to 50 minutes, then break the loop.
|
||||||
for (var i = 0; i < loopCount; i++) {
|
for (var i = 0; i < loopCount; i++) {
|
||||||
|
|||||||
@@ -49,9 +49,13 @@ class RatePassenger extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
child: Text(
|
child: Text(
|
||||||
Get.find<MapDriverController>().cartype ==
|
Get.find<MapDriverController>().cartype ==
|
||||||
'Comfort'
|
'Comfort' ||
|
||||||
|
Get.find<MapDriverController>()
|
||||||
|
.cartype ==
|
||||||
|
'Free Ride'
|
||||||
? Get.find<MapDriverController>()
|
? Get.find<MapDriverController>()
|
||||||
.totalCost
|
.price
|
||||||
|
.toStringAsFixed(1)
|
||||||
: Get.find<MapDriverController>()
|
: Get.find<MapDriverController>()
|
||||||
.totalPassenger,
|
.totalPassenger,
|
||||||
style: AppStyle.number,
|
style: AppStyle.number,
|
||||||
|
|||||||
@@ -65,7 +65,22 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
|||||||
'Price is ${mapDriverController.price.toStringAsFixed(0)}')
|
'Price is ${mapDriverController.price.toStringAsFixed(0)}')
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
mapDriverController.cartype == 'Free Ride'
|
||||||
|
? Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'End Ride'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
mapDriverController.finishRideFromDriver();
|
||||||
|
},
|
||||||
|
kolor: AppColor.redColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
mapDriverController.remainingTimeTimerRideBegin < 60 &&
|
||||||
|
mapDriverController.cartype != 'Free Ride'
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -21,19 +21,19 @@ class CarType {
|
|||||||
|
|
||||||
List<CarType> carTypes = [
|
List<CarType> carTypes = [
|
||||||
CarType(
|
CarType(
|
||||||
carType: 'Comfort'.tr,
|
carType: 'Comfort',
|
||||||
carDetail: 'Comfort choice'.tr,
|
carDetail: 'Comfort choice'.tr,
|
||||||
image: 'assets/images/blob.png'),
|
image: 'assets/images/blob.png'),
|
||||||
CarType(
|
CarType(
|
||||||
carType: 'Speed'.tr,
|
carType: 'Speed',
|
||||||
carDetail: 'Better for long trips choice'.tr,
|
carDetail: 'Better for long trips choice'.tr,
|
||||||
image: 'assets/images/carspeed.png'),
|
image: 'assets/images/carspeed.png'),
|
||||||
CarType(
|
CarType(
|
||||||
carType: 'Delivery'.tr,
|
carType: 'Delivery',
|
||||||
carDetail: 'Delivery service'.tr,
|
carDetail: 'Delivery service'.tr,
|
||||||
image: 'assets/images/moto.png'),
|
image: 'assets/images/moto.png'),
|
||||||
CarType(
|
CarType(
|
||||||
carType: 'Free Ride'.tr,
|
carType: 'Free Ride',
|
||||||
carDetail: 'free ride without end point'.tr,
|
carDetail: 'free ride without end point'.tr,
|
||||||
image: 'assets/images/freeRide.png'),
|
image: 'assets/images/freeRide.png'),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user