1/18/1
This commit is contained in:
@@ -185,6 +185,7 @@ class HomeCaptainController extends GetxController {
|
||||
getPaymentToday();
|
||||
getAllPayment();
|
||||
startPeriodicExecution();
|
||||
onMapCreated(mapHomeCaptaiController!);
|
||||
getRefusedOrderByCaptain();
|
||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||
super.onInit();
|
||||
|
||||
@@ -31,11 +31,17 @@ class MapDriverController extends GetxController {
|
||||
Set<Marker> markers = {};
|
||||
late String passengerLocation;
|
||||
late String passengerDestination;
|
||||
late String step0;
|
||||
late String step1;
|
||||
late String step2;
|
||||
late String step3;
|
||||
late String step4;
|
||||
late String duration;
|
||||
late String distance;
|
||||
late String name;
|
||||
late String phone;
|
||||
late String rideId;
|
||||
late String isHaveSteps;
|
||||
late String paymentAmount;
|
||||
late String paymentMethod;
|
||||
late String passengerId;
|
||||
@@ -311,20 +317,15 @@ class MapDriverController extends GetxController {
|
||||
),
|
||||
);
|
||||
|
||||
// Update the `markers` set and call the `update()` method on the controller to notify the view that the marker position has changed.
|
||||
update();
|
||||
|
||||
// No recursive call here. The marker update will be triggered externally.
|
||||
|
||||
// Optionally, you can animate the camera to the new location after updating the marker.
|
||||
mapController!.animateCamera(
|
||||
CameraUpdate.newLatLng(locationController.myLocation),
|
||||
);
|
||||
update();
|
||||
}
|
||||
|
||||
void addCustomCarIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: Size(Get.width * .6, Get.height * .6),
|
||||
ImageConfiguration config = const ImageConfiguration(
|
||||
size: Size(20, 20),
|
||||
// scale: 1.0,
|
||||
);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/car.png')
|
||||
@@ -441,13 +442,25 @@ class MapDriverController extends GetxController {
|
||||
rideId = Get.arguments['rideId'];
|
||||
durationOfRideValue = Get.arguments['durationOfRideValue'];
|
||||
paymentAmount = Get.arguments['paymentAmount'];
|
||||
paymentMethod = Get.arguments['paymentMethod'];
|
||||
isHaveSteps = Get.arguments['isHaveSteps'];
|
||||
step0 = Get.arguments['step0'];
|
||||
step1 = Get.arguments['step1'];
|
||||
step2 = Get.arguments['step2'];
|
||||
step3 = Get.arguments['step3'];
|
||||
step4 = Get.arguments['step4'];
|
||||
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
||||
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
||||
String origin = '$lat,$lng';
|
||||
// Set the origin and destination coordinates for the Google Maps directions request.
|
||||
getMap(origin, passengerLocation);
|
||||
await getMapDestination(passengerLocation, passengerDestination);
|
||||
isHaveSteps == 'haveSteps'
|
||||
? (
|
||||
await getMapDestination(step0, step1),
|
||||
await getMapDestination(step1, step2),
|
||||
await getMapDestination(step2, step3),
|
||||
await getMapDestination(step3, step4),
|
||||
)
|
||||
: await getMapDestination(passengerLocation, passengerDestination);
|
||||
addCustomCarIcon();
|
||||
// updateMarker();
|
||||
startTimerToShowPassengerInfoWindowFromDriver();
|
||||
|
||||
Reference in New Issue
Block a user