6/30/1
This commit is contained in:
@@ -222,7 +222,8 @@ class MapDriverController extends GetxController {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'DriverIsGoingToPassenger',
|
||||
box.read(BoxName.name).toString(),
|
||||
tokenPassenger);
|
||||
tokenPassenger,
|
||||
'start.wav');
|
||||
if (box.read(BoxName.googlaMapApp) == true) {
|
||||
await openGoogleMapFromDriverToPassenger();
|
||||
}
|
||||
@@ -288,7 +289,10 @@ class MapDriverController extends GetxController {
|
||||
});
|
||||
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
||||
'RideIsBegin',
|
||||
box.read(BoxName.name).toString(),
|
||||
tokenPassenger,
|
||||
'start.wav');
|
||||
rideIsBeginPassengerTimer();
|
||||
|
||||
// var d = jsonDecode(res);
|
||||
@@ -352,6 +356,7 @@ class MapDriverController extends GetxController {
|
||||
}
|
||||
|
||||
calculateDistanceBetweenDriverAndPassengerLocation() {
|
||||
Get.put(LocationController());
|
||||
double distance2 = Geolocator.distanceBetween(
|
||||
latLngPassengerLocation.latitude,
|
||||
latLngPassengerLocation.longitude,
|
||||
@@ -533,19 +538,19 @@ class MapDriverController extends GetxController {
|
||||
});
|
||||
Future.delayed(const Duration(milliseconds: 300));
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Driver Finish Trip',
|
||||
'${'you will pay to Driver'.tr} $paymentAmount \$',
|
||||
tokenPassenger,
|
||||
[
|
||||
box.read(BoxName.driverID),
|
||||
rideId,
|
||||
box.read(BoxName.tokenDriver),
|
||||
// carType == 'Comfort' || carType == 'Mashwari'
|
||||
// ? price.toStringAsFixed(2)
|
||||
// : totalPassenger
|
||||
paymentAmount.toString()
|
||||
],
|
||||
);
|
||||
'Driver Finish Trip',
|
||||
'${'you will pay to Driver'.tr} $paymentAmount \$',
|
||||
tokenPassenger,
|
||||
[
|
||||
box.read(BoxName.driverID),
|
||||
rideId,
|
||||
box.read(BoxName.tokenDriver),
|
||||
// carType == 'Comfort' || carType == 'Mashwari'
|
||||
// ? price.toStringAsFixed(2)
|
||||
// : totalPassenger
|
||||
paymentAmount.toString()
|
||||
],
|
||||
'ding.wav');
|
||||
Get.to(() => RatePassenger(), arguments: {
|
||||
'passengerId': passengerId,
|
||||
'rideId': rideId,
|
||||
|
||||
@@ -95,21 +95,29 @@ class OrderRequestController extends GetxController {
|
||||
List<Map<String, dynamic>> results = await sql.getCustomQuery(customQuery);
|
||||
}
|
||||
|
||||
void startTimer(String driverID, orderID) async {
|
||||
for (int i = 0; i <= duration; i++) {
|
||||
bool _timerActive = false;
|
||||
|
||||
Future<void> startTimer(String driverID, String orderID) async {
|
||||
_timerActive = true;
|
||||
for (int i = 0; i <= duration && _timerActive; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
progress = i / duration;
|
||||
remainingTime = duration - i;
|
||||
|
||||
update();
|
||||
}
|
||||
if (remainingTime == 0) {
|
||||
if (remainingTime == 0 && _timerActive) {
|
||||
if (applied == false) {
|
||||
endTimer();
|
||||
refuseOrder(orderID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void endTimer() {
|
||||
_timerActive = false;
|
||||
}
|
||||
|
||||
void startTimerSpeed(String driverID, orderID) async {
|
||||
for (int i = 0; i <= durationSpeed; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
@@ -144,15 +152,16 @@ class OrderRequestController extends GetxController {
|
||||
});
|
||||
|
||||
// applied = true;
|
||||
sql.insertData({
|
||||
'order_id': orderID,
|
||||
'created_at': DateTime.now().toString(),
|
||||
'driver_id': box.read(BoxName.driverID).toString(),
|
||||
}, TableName.driverOrdersRefuse);
|
||||
getRefusedOrderByCaptain();
|
||||
|
||||
if (box.read(BoxName.gender).toString() != 'Female') {
|
||||
sql.insertData({
|
||||
'order_id': orderID,
|
||||
'created_at': DateTime.now().toString(),
|
||||
'driver_id': box.read(BoxName.driverID).toString(),
|
||||
}, TableName.driverOrdersRefuse);
|
||||
getRefusedOrderByCaptain();
|
||||
}
|
||||
update();
|
||||
Get.back();
|
||||
// Get.back();
|
||||
// Get.offAll(HomeCaptain());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user