This commit is contained in:
Hamza Aleghwairyeen
2024-03-30 13:28:23 +03:00
parent c853d89037
commit 6e417cbb75
7 changed files with 111 additions and 59 deletions

View File

@@ -500,7 +500,9 @@ update ui for totla results
isRideFinished = true;
isRideStarted = false;
isPriceWindow = false;
if (cartype == 'Comfort') {
totalCost = (price * rideTimerFromBegin).toString();
}
box.write(BoxName.statusDriverLocation, 'off');
// changeRideToBeginToPassenger();
await CRUD().post(link: AppLink.updateRides, payload: {
@@ -586,6 +588,8 @@ update ui for totla results
}
}
int rideTimerFromBegin = 0;
double price = 0;
void rideIsBeginPassengerTimer() async {
// print('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm');
// print(durationOfRideValue);
@@ -593,6 +597,12 @@ update ui for totla results
update();
for (int i = 0; i <= durationOfRide; i++) {
await Future.delayed(const Duration(seconds: 1));
recentDistanceToDash = Get.find<LocationController>().totalDistance;
rideTimerFromBegin = i;
price = rideTimerFromBegin ~/ 60 +
(recentDistanceToDash * 4); //todo from kazan
price = (price * .10) + price;
speed = Get.find<LocationController>().speed;
progressTimerRideBegin = i / durationOfRide;
remainingTimeTimerRideBegin = durationOfRide - i;
remainingTimeTimerRideBegin < 60 ? driverEndPage = 160 : 100;
@@ -646,6 +656,7 @@ update ui for totla results
double recentDistanceToDash = 0;
double recentAngelToMarker = 0;
double speed = 0;
void updateMarker() async {
// Remove the existing marker with the ID `MyLocation`.
markers.remove(MarkerId('MyLocation'));
@@ -884,6 +895,7 @@ LIMIT
late Duration durationToAdd;
int hours = 0;
int minutes = 0;
late String cartype;
@override
void onInit() async {
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
@@ -915,6 +927,7 @@ LIMIT
step4 = Get.arguments['step4'];
passengerWalletBurc = Get.arguments['passengerWalletBurc'];
timeOfOrder = Get.arguments['timeOfOrder'];
cartype = Get.arguments['carType'];
var coords = passengerLocation.split(',');
var coordDestination = passengerDestination.split(',');

View File

@@ -466,8 +466,8 @@ class MapPassengerController extends GetxController {
void sendWhatsapp(String to) async {
// Get the driver's phone number.
String driverPhone =
dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
// String driverPhone =
// dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
// Format the message.
String message =
@@ -845,6 +845,7 @@ class MapPassengerController extends GetxController {
box.read(BoxName.email).toString(),
startNameAddress,
endNameAddress,
box.read(BoxName.carType),
];
print(body);
FirebaseMessagesController().sendNotificationToDriverMapPolyline(
@@ -920,6 +921,7 @@ class MapPassengerController extends GetxController {
box.read(BoxName.email).toString(),
startNameAddress,
endNameAddress,
box.read(BoxName.carType),
];
print('driversToken');
print(driversToken);