6/22/1
This commit is contained in:
@@ -40,12 +40,10 @@ class DurationController extends GetxController {
|
||||
payload: {'driverID': box.read(BoxName.driverID)});
|
||||
if (res == 'failure') {
|
||||
monthlyList = [];
|
||||
print('monthlyList $monthlyList');
|
||||
isLoading = false;
|
||||
update();
|
||||
} else {
|
||||
monthlyList = jsonDecode(res)['message'];
|
||||
print(monthlyList);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
@@ -62,7 +60,6 @@ class DurationController extends GetxController {
|
||||
jsonData1 = jsonDecode(res);
|
||||
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
||||
isLoading = false;
|
||||
// print(jsonResponse);
|
||||
final List<dynamic> jsonData = jsonResponse['message'];
|
||||
rideData = jsonData.map<MonthlyDataModel>((item) {
|
||||
return MonthlyDataModel.fromJson(item);
|
||||
@@ -90,7 +87,6 @@ class DurationController extends GetxController {
|
||||
jsonData2 = jsonDecode(res);
|
||||
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
||||
isLoading = false;
|
||||
// print(jsonResponse);
|
||||
final List<dynamic> jsonData = jsonResponse['message'];
|
||||
rideCountData = jsonData.map<MonthlyRideModel>((item) {
|
||||
return MonthlyRideModel.fromJson(item);
|
||||
|
||||
@@ -33,7 +33,6 @@ class HelpController extends GetxController {
|
||||
'helpQuestion': helpQuestionController.text
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d);
|
||||
isLoading = false;
|
||||
update();
|
||||
if (d['status'].toString() == 'success') {
|
||||
@@ -51,7 +50,6 @@ class HelpController extends GetxController {
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
if (res == "failure") {
|
||||
// print(res);
|
||||
isLoading = false;
|
||||
update();
|
||||
Get.defaultDialog(
|
||||
@@ -76,7 +74,6 @@ class HelpController extends GetxController {
|
||||
var res = await CRUD().get(link: AppLink.getByIdhelpCenter, payload: {
|
||||
'id': id,
|
||||
});
|
||||
print(res);
|
||||
if (res == "failure") {
|
||||
status = 'not yet';
|
||||
isLoading = false;
|
||||
|
||||
@@ -124,7 +124,6 @@ class HomeCaptainController extends GetxController {
|
||||
countRefuse = results[0]['count'].toString();
|
||||
update();
|
||||
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -300) {
|
||||
print('total point is $totalPoints');
|
||||
locationController.stopLocationUpdates();
|
||||
activeStartTime = null;
|
||||
activeTimer?.cancel();
|
||||
@@ -148,9 +147,7 @@ class HomeCaptainController extends GetxController {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error executing custom query: $e');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
void changeMapType() {
|
||||
@@ -207,13 +204,11 @@ class HomeCaptainController extends GetxController {
|
||||
}
|
||||
|
||||
void stopTimer() {
|
||||
print('Stopping timer');
|
||||
timer?.cancel();
|
||||
}
|
||||
|
||||
getlocation() async {
|
||||
isLoading = true;
|
||||
print('isLoading $isLoading');
|
||||
update();
|
||||
await Get.find<LocationController>().getLocation();
|
||||
isLoading = false;
|
||||
@@ -244,7 +239,7 @@ class HomeCaptainController extends GetxController {
|
||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||
'token': box.read(BoxName.tokenDriver),
|
||||
'captain_id': box.read(BoxName.driverID).toString()
|
||||
}).then((value) => print('Token Added'));
|
||||
});
|
||||
MapDriverController().driverCallPassenger();
|
||||
// box.write(BoxName.statusDriverLocation, 'off');
|
||||
}
|
||||
@@ -258,9 +253,7 @@ class HomeCaptainController extends GetxController {
|
||||
totalMoneyToday = data['message'][0]['todayAmount'];
|
||||
|
||||
update();
|
||||
} else {
|
||||
print(res);
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
|
||||
getKazanPercent() async {
|
||||
@@ -279,7 +272,6 @@ class HomeCaptainController extends GetxController {
|
||||
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
|
||||
mashwariPrice = double.parse(json['message'][0]['freePrice']);
|
||||
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
|
||||
print(json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +287,6 @@ class HomeCaptainController extends GetxController {
|
||||
data = jsonDecode(res);
|
||||
|
||||
countRideToday = data['message'][0]['count'].toString();
|
||||
// print(countRideToday);
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -77,9 +77,7 @@ class OrderRequestController extends GetxController {
|
||||
} else {
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error executing custom query: $e');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
void getSQL() async {
|
||||
@@ -95,7 +93,6 @@ class OrderRequestController extends GetxController {
|
||||
AND created_at LIKE '%$todayDay%'
|
||||
''';
|
||||
List<Map<String, dynamic>> results = await sql.getCustomQuery(customQuery);
|
||||
print(results);
|
||||
}
|
||||
|
||||
void startTimer(String driverID, orderID) async {
|
||||
@@ -108,8 +105,6 @@ class OrderRequestController extends GetxController {
|
||||
}
|
||||
if (remainingTime == 0) {
|
||||
if (applied == false) {
|
||||
print('applied=========================');
|
||||
print(applied);
|
||||
refuseOrder(orderID);
|
||||
}
|
||||
}
|
||||
@@ -125,8 +120,6 @@ class OrderRequestController extends GetxController {
|
||||
}
|
||||
if (remainingTimeSpeed == 0) {
|
||||
if (applied == false) {
|
||||
print('applied=========================');
|
||||
print(applied);
|
||||
Get.back();
|
||||
// refuseOrder(box.read(BoxName.driverID), orderID);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ class MyMenuController extends GetxController {
|
||||
} else {
|
||||
isDrawerOpen = true;
|
||||
}
|
||||
print(isDrawerOpen);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,14 +98,12 @@ class CaptainWalletController extends GetxController {
|
||||
if (res != 'failure') {
|
||||
walletDate = jsonDecode(res);
|
||||
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
|
||||
print(totalAmount);
|
||||
|
||||
var res1 = await CRUD().get(
|
||||
link: AppLink.getAllPaymentVisa,
|
||||
payload: {'driverID': box.read(BoxName.driverID)});
|
||||
walletDateVisa = jsonDecode(res1);
|
||||
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
|
||||
print(totalAmountVisa);
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -141,7 +139,6 @@ class CaptainWalletController extends GetxController {
|
||||
'amount': amount.toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
print('paymentToken ${d['message']}');
|
||||
return d['message'];
|
||||
}
|
||||
|
||||
@@ -155,7 +152,6 @@ class CaptainWalletController extends GetxController {
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
paymentID = d['message'].toString();
|
||||
print('paymentID $paymentID');
|
||||
return paymentID;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,6 @@ class CreditCardController extends GetxController {
|
||||
// String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
|
||||
// String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
|
||||
|
||||
// print('cardNumber: $cardNumber');
|
||||
// print('cardHolderName: $cardHolderName');
|
||||
// print('expiryDate: $expiryDate');
|
||||
// print('cvvCode: $cvvCode');
|
||||
|
||||
// if (cvvCode != null && cvvCode.isNotEmpty) {
|
||||
// final maskedCardNumber = DigitObscuringFormatter()
|
||||
// .formatEditUpdate(
|
||||
@@ -57,8 +52,6 @@ class CreditCardController extends GetxController {
|
||||
// )
|
||||
// .text;
|
||||
|
||||
// print('maskedCardNumber: $maskedCardNumber');
|
||||
|
||||
// cardNumberController.text = maskedCardNumber;
|
||||
// cardHolderNameController.text = cardHolderName ?? '';
|
||||
// expiryDateController.text = expiryDate ?? '';
|
||||
|
||||
@@ -39,7 +39,6 @@ class PaymobPayout extends GetxController {
|
||||
var decode = jsonDecode(res.body);
|
||||
token = decode['access_token'];
|
||||
}
|
||||
print('token = $token');
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -55,15 +54,12 @@ class PaymobPayout extends GetxController {
|
||||
"issuer": issuer, //"vodafone",
|
||||
"msisdn": msisdn, // "01023456789"
|
||||
});
|
||||
print(body);
|
||||
var res = await http.post(
|
||||
Uri.parse(
|
||||
'https://stagingpayouts.paymobsolutions.com/api/secure/disburse/'),
|
||||
headers: headers,
|
||||
body: body,
|
||||
);
|
||||
print(jsonDecode(res.body));
|
||||
print('-----');
|
||||
var dec = jsonDecode(res.body);
|
||||
if (dec['disbursement_status'] == 'successful') {
|
||||
var paymentToken = await Get.find<CaptainWalletController>()
|
||||
@@ -108,14 +104,12 @@ class PaymobPayout extends GetxController {
|
||||
};
|
||||
var res = await http
|
||||
.post(
|
||||
Uri.parse(
|
||||
'https://stagingpayouts.paymobsolutions.com/api/secure/disburse/'),
|
||||
headers: headers,
|
||||
body: body,
|
||||
)
|
||||
.then((value) {
|
||||
print(value);
|
||||
});
|
||||
Uri.parse(
|
||||
'https://stagingpayouts.paymobsolutions.com/api/secure/disburse/'),
|
||||
headers: headers,
|
||||
body: body,
|
||||
)
|
||||
.then((value) {});
|
||||
}
|
||||
|
||||
Future payToWalletDriverAll(
|
||||
|
||||
@@ -25,7 +25,6 @@ class PointsForRiderController extends GetxController {
|
||||
}
|
||||
|
||||
void removeLocation(int index) {
|
||||
print(index);
|
||||
locations.removeAt(index);
|
||||
update();
|
||||
}
|
||||
@@ -95,25 +94,18 @@ class WayPointController extends GetxController {
|
||||
}
|
||||
|
||||
void updatePlace(int index, String input) async {
|
||||
print(myLocation);
|
||||
print(index);
|
||||
print(input);
|
||||
var url =
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=$input&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
print(url);
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
// final place = input;
|
||||
// print(response);
|
||||
// if (index == 0) {
|
||||
List<dynamic> newList = [];
|
||||
placeListResponse.add(newList);
|
||||
newList = response['results'];
|
||||
print(newList);
|
||||
placeListResponse[index].add(newList);
|
||||
update();
|
||||
// }
|
||||
|
||||
print(placeListResponse[index]);
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ class FeedBackController extends GetxController {
|
||||
'feedBack': feedbackController.text
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d);
|
||||
if (d['status'].toString() == 'success') {
|
||||
Get.defaultDialog(
|
||||
title: 'Success'.tr,
|
||||
|
||||
@@ -28,7 +28,6 @@ class OrderHistoryController extends GetxController {
|
||||
var jsonDecoded = jsonDecode(res);
|
||||
|
||||
orderHistoryListPassenger = jsonDecoded['data'];
|
||||
// print(orderHistoryListPassenger);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ class PromosController extends GetxController {
|
||||
promoList = jsonDecoded['message'];
|
||||
isLoading = false;
|
||||
update();
|
||||
print(promoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user