This commit is contained in:
Hamza-Ayed
2024-07-31 21:19:19 +03:00
parent dea83d970c
commit 2bc71355c3
106 changed files with 4600 additions and 727 deletions

View File

@@ -229,7 +229,7 @@ class HomeCaptainController extends GetxController {
getAllPayment();
startPeriodicExecution();
onMapCreated(mapHomeCaptainController!);
totalPoints = Get.find<CaptainWalletController>().totalPoints;
totalPoints = Get.find<CaptainWalletController>().totalPoints.toString();
getRefusedOrderByCaptain();
// LocationController().getLocation();
super.onInit();

View File

@@ -26,8 +26,10 @@ class MapDriverController extends GetxController {
bool isLoading = true;
final formKey1 = GlobalKey<FormState>();
final formKey2 = GlobalKey<FormState>();
final formKeyCancel = GlobalKey<FormState>();
final messageToPassenger = TextEditingController();
final sosEmergincyNumberCotroller = TextEditingController();
final cancelTripCotroller = TextEditingController();
List data = [];
List dataDestination = [];
LatLngBounds? boundsData;
@@ -165,6 +167,30 @@ class MapDriverController extends GetxController {
update();
}
cancelTripFromDriverAfterApplied() async {
if (formKeyCancel.currentState!.validate()) {
await CRUD().post(link: AppLink.updateRides, payload: {
"id": rideId.toString(), // Convert to String
"status": 'CancelFromDriverAfterApply'
});
await CRUD().post(link: AppLink.addCancelRideFromPassenger, payload: {
"rideID": rideId.toString(),
"driverID": box.read(BoxName.driverID).toString(),
"passengerID": passengerId.toString(),
"note": cancelTripCotroller.text.toString()
});
FirebaseMessagesController().sendNotificationToDriverMAP(
"Cancel Trip from driver".tr,
"Trip Cancelled from driver. We are looking for a new driver. Please wait."
.tr,
tokenPassenger,
[],
'cancel.wav',
);
Get.offAll(HomeCaptain());
}
}
void startTimerToShowPassengerInfoWindowFromDriver() async {
if (box.read(BoxName.rideStatus) == 'Begin') {
isPassengerInfoWindow = false;

View File

@@ -33,6 +33,12 @@ class OrderRequestController extends GetxController {
super.onInit();
}
getRideDEtailsForBackgroundOrder() async {
await CRUD().get(link: AppLink.getRidesDetails, payload: {
'id': box.read(BoxName.myList)[2].toString(),
});
}
void addCustomStartIcon() async {
// Create the marker with the resized image