This commit is contained in:
Hamza-Ayed
2024-02-04 23:53:13 +03:00
parent 87da645ae5
commit 481eff94c2
24 changed files with 708 additions and 332 deletions

View File

@@ -267,10 +267,14 @@ class MapDriverController extends GetxController {
'passengerId': passengerId,
'driverId': driverId
});
FirebaseMessagesController().sendNotificationToAnyWithoutData(
'Captain Finish Trip',
FirebaseMessagesController().sendNotificationToPassengerToken(
'Driver Finish Trip',
box.read(BoxName.name).toString(),
tokenPassenger);
tokenPassenger, [
box.read(BoxName.driverID),
rideId,
box.read(BoxName.tokenDriver),
]);
}
void cancelCheckRidefromPassenger() async {

View File

@@ -93,6 +93,8 @@ class MapPassengerController extends GetxController {
double mainBottomMenuMapHeight = Get.height * .2;
double wayPointSheetHeight = 0;
bool startLocationFromMap = false;
bool workLocationFromMap = false;
bool homeLocationFromMap = false;
bool startLocationFromMap0 = false;
bool startLocationFromMap1 = false;
bool startLocationFromMap2 = false;
@@ -161,7 +163,7 @@ class MapPassengerController extends GetxController {
List<String> currentLocationStringAll = [];
List<String> hintTextwayPointStringAll = [];
var placesCoordinate = <String>[];
String hintTextDestinationPoint = 'Search for your destination'.tr;
String hintTextDestinationPoint = 'Select your destination'.tr;
late String rideId;
bool noCarString = false;
bool isCashSelectedBeforeConfirmRide = false;
@@ -218,6 +220,7 @@ class MapPassengerController extends GetxController {
durationToRide = 0;
distanceOfDestnation = 0;
wayPointSheetHeight = 0;
haveSteps = true;
for (var i = 0; i < Get.find<WayPointController>().wayPoints.length; i++) {
if (placesCoordinate[i + 1].toString() != '') {
await getMapPoints(
@@ -346,6 +349,16 @@ class MapPassengerController extends GetxController {
}
}
void convertHintTextDestinationNewPlacesFromRecent(
List recentLocations, int index) {
hintTextDestinationPoint = recentLocations[index]['name'];
double lat = recentLocations[index]['latitude'];
double lng = recentLocations[index]['longitude'];
newMyLocation = LatLng(lat, lng);
update();
}
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
void changeBottomSheetShown() {
isBottomSheetShown = !isBottomSheetShown;
@@ -486,10 +499,10 @@ class MapPassengerController extends GetxController {
'passenger_id': box.read(BoxName.passengerID).toString(),
'balance': ((-1) * totalPassenger).toString()
});
Get.to(() => RateCaptainFromPassenger(), arguments: {
'driverId': driverId.toString(),
'rideId': rideId.toString(),
});
// Get.to(() => RateCaptainFromPassenger(), arguments: {
// 'driverId': driverId.toString(),
// 'rideId': rideId.toString(),
// });
}
void getBeginRideFromDriver() async {
@@ -634,7 +647,7 @@ class MapPassengerController extends GetxController {
'${data[0]["end_location"]['lat']},${data[0]["end_location"]['lng']}',
totalPassenger.toString(),
totalDriver.toString(),
duration.toString(),
durationToRide.toString(),
distance.toString(),
dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
.toString(),
@@ -985,7 +998,7 @@ class MapPassengerController extends GetxController {
} else {
isMainBottomMenuMap = !isMainBottomMenuMap;
mainBottomMenuMapHeight =
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .6;
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .5;
isWayPointSheet = false;
if (heightMenuBool == true) {
getDrawerMenu();
@@ -1499,10 +1512,10 @@ class MapPassengerController extends GetxController {
double distanceOfDestnation = 0;
bool haveSteps = false;
late LatLng latestPosition;
late LatLng latestPosition = LatLng(0, 0);
getMapPoints(String originSteps, String destinationSteps, int index) async {
isWayPointStopsSheetUtilGetMap = false;
haveSteps = true;
// haveSteps = true;
await getCarsLocationByPassenger();
// isLoading = true;
update();
@@ -1521,9 +1534,11 @@ class MapPassengerController extends GetxController {
final points =
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
for (int i = 0; i < points.length; i++) {
double lat = points[i][0].toDouble();
double lng = points[i][1].toDouble();
polylineCoordinatesPointsAll[index].add(LatLng(lat, lng));
if (points[i][0].toString() != '') {
double lat = points[i][0].toDouble();
double lng = points[i][1].toDouble();
polylineCoordinatesPointsAll[index].add(LatLng(lat, lng));
}
}
// Define the northeast and southwest coordinates

View File

@@ -73,6 +73,8 @@ class CaptainWalletController extends GetxController {
//check if account bank is created or not
Future checkAccountCaptainBank() async {
isLoading = false;
update();
if (box.read(BoxName.accountIdStripeConnect).toString().isEmpty) {
var res = await CRUD().get(link: AppLink.getAccount, payload: {
'id': box.read(BoxName.driverID).toString(),
@@ -83,6 +85,8 @@ class CaptainWalletController extends GetxController {
d['message'][0]['accountBank'].toString());
}
}
isLoading = true;
update();
}
@override