6/22/1
This commit is contained in:
@@ -173,11 +173,8 @@ class MapDriverController extends GetxController {
|
||||
remainingTimeToPassenger = int.parse(durationToPassenger) - i;
|
||||
if (remainingTimeToPassenger == 0) {
|
||||
isBtnRideBegin = true;
|
||||
print(isBtnRideBegin);
|
||||
update();
|
||||
}
|
||||
print(isBtnRideBegin);
|
||||
print(remainingTimeToPassenger);
|
||||
|
||||
int minutes = (remainingTimeToPassenger / 60).floor();
|
||||
int seconds = remainingTimeToPassenger % 60;
|
||||
@@ -205,12 +202,9 @@ class MapDriverController extends GetxController {
|
||||
}
|
||||
if (remainingTimeInPassengerLocatioWait == 0) {
|
||||
isdriverWaitTimeEnd = true;
|
||||
print(isdriverWaitTimeEnd);
|
||||
update();
|
||||
}
|
||||
print(isdriverWaitTimeEnd);
|
||||
print(
|
||||
'remainingTimeInPassengerLocatioWait $remainingTimeInPassengerLocatioWait');
|
||||
'remainingTimeInPassengerLocatioWait $remainingTimeInPassengerLocatioWait';
|
||||
|
||||
int minutes = (remainingTimeInPassengerLocatioWait / 60).floor();
|
||||
int seconds = remainingTimeInPassengerLocatioWait % 60;
|
||||
@@ -267,13 +261,10 @@ class MapDriverController extends GetxController {
|
||||
'driverID': box.read(BoxName.driverID),
|
||||
});
|
||||
if (res == 'failure') {
|
||||
print('Scam is failure');
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
return '0';
|
||||
}
|
||||
var d = jsonDecode(res);
|
||||
print('Scam is ');
|
||||
print(d['message'][0]['count']);
|
||||
return d['message'][0]['count'];
|
||||
}
|
||||
|
||||
@@ -411,7 +402,6 @@ class MapDriverController extends GetxController {
|
||||
'token': paymentTokenWait1,
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
print(res1);
|
||||
if (res != 'failure') {
|
||||
Get.snackbar(
|
||||
'You will get cost of your work for this trip'.tr,
|
||||
@@ -458,7 +448,6 @@ class MapDriverController extends GetxController {
|
||||
'amount': amount.toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
print('paymentToken ${d['message']}');
|
||||
return d['message'];
|
||||
}
|
||||
|
||||
@@ -470,7 +459,6 @@ class MapDriverController extends GetxController {
|
||||
'amount': amount.toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
print('paymentToken ${d['message']}');
|
||||
return d['message'];
|
||||
}
|
||||
|
||||
@@ -504,7 +492,6 @@ class MapDriverController extends GetxController {
|
||||
'status': 'Finished',
|
||||
'price': totalCost,
|
||||
});
|
||||
print('walletChecked is $walletChecked');
|
||||
if (walletChecked == 'true') {
|
||||
paymentToken = await generateTokenPassenger(
|
||||
((-1) * double.parse(paymentAmount)).toString());
|
||||
@@ -524,7 +511,6 @@ class MapDriverController extends GetxController {
|
||||
'token': paymentToken,
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
print('passengerWalletBurc bef ${double.parse(passengerWalletBurc)}');
|
||||
if (double.parse(passengerWalletBurc) < 0) {
|
||||
// for zero passenger
|
||||
var paymentToken1 = await generateTokenPassenger(
|
||||
@@ -534,7 +520,6 @@ class MapDriverController extends GetxController {
|
||||
'token': paymentToken1,
|
||||
'balance': ((-1) * double.parse(passengerWalletBurc)).toString()
|
||||
});
|
||||
print('passengerWalletBurc aft ${double.parse(passengerWalletBurc)}');
|
||||
}
|
||||
|
||||
double pointsSubtraction = 0;
|
||||
@@ -551,7 +536,6 @@ class MapDriverController extends GetxController {
|
||||
'token': paymentToken2,
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
print(res);
|
||||
Future.delayed(const Duration(milliseconds: 300));
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Driver Finish Trip',
|
||||
@@ -581,10 +565,8 @@ class MapDriverController extends GetxController {
|
||||
var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: {
|
||||
'order_id': rideId,
|
||||
}); //.then((value) {
|
||||
print('Cancel fetch--------------------');
|
||||
var response = jsonDecode(res);
|
||||
canelString = response['data']['status'];
|
||||
print('cancel is $canelString');
|
||||
update();
|
||||
if (canelString == 'Cancel') {
|
||||
remainingTimeTimerRideBegin = 0;
|
||||
@@ -613,8 +595,6 @@ class MapDriverController extends GetxController {
|
||||
int rideTimerFromBegin = 0;
|
||||
double price = 0;
|
||||
void rideIsBeginPassengerTimer() async {
|
||||
// print('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm');
|
||||
// print(durationOfRideValue);
|
||||
int durationOfRide = int.parse(durationOfRideValue);
|
||||
update();
|
||||
int infinity = 40000;
|
||||
@@ -764,7 +744,6 @@ class MapDriverController extends GetxController {
|
||||
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
data = response['routes'][0]['legs'];
|
||||
print(data);
|
||||
distanceBetweenDriverAndPassengerWhenConfirm =
|
||||
(data[0]['distance']['value']) / 1000;
|
||||
final points =
|
||||
@@ -824,7 +803,6 @@ class MapDriverController extends GetxController {
|
||||
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
dataDestination = response['routes'][0]['legs'];
|
||||
// print(data);
|
||||
final points =
|
||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||
for (int i = 0; i < points.length; i++) {
|
||||
@@ -892,14 +870,10 @@ class MapDriverController extends GetxController {
|
||||
|
||||
argumentLoading() async {
|
||||
passengerLocation = Get.arguments['passengerLocation'];
|
||||
print(passengerLocation);
|
||||
passengerDestination = Get.arguments['passengerDestination'];
|
||||
print(passengerDestination);
|
||||
duration = Get.arguments['Duration'];
|
||||
totalCost = Get.arguments['totalCost'];
|
||||
passengerId = Get.arguments['passengerId'];
|
||||
print('passengerID argument =${Get.arguments['passengerId']} ');
|
||||
print('passengerID =$passengerId ');
|
||||
driverId = Get.arguments['driverId'];
|
||||
distance = Get.arguments['Distance'];
|
||||
passengerName = Get.arguments['name'];
|
||||
@@ -933,8 +907,6 @@ class MapDriverController extends GetxController {
|
||||
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
||||
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
||||
String origin = '$lat,$lng';
|
||||
print('latLngpassengerLocation $latLngPassengerLocation');
|
||||
print('latLngPassengerDestination $latLngPassengerDestination');
|
||||
// Set the origin and destination coordinates for the Google Maps directions request.
|
||||
Future.delayed(const Duration(seconds: 1));
|
||||
getMap(origin, passengerLocation);
|
||||
@@ -952,7 +924,6 @@ class MapDriverController extends GetxController {
|
||||
latlng(String passengerLocation, passengerDestination) {
|
||||
double latPassengerLocation =
|
||||
double.parse(passengerLocation.toString().split(',')[0]);
|
||||
print('latPassengerLocation $latPassengerLocation');
|
||||
double lngPassengerLocation =
|
||||
double.parse(passengerLocation.toString().split(',')[1]);
|
||||
double latPassengerDestination =
|
||||
|
||||
Reference in New Issue
Block a user