This commit is contained in:
Hamza-Ayed
2024-01-19 15:17:18 +03:00
parent 7af7e71b30
commit ec7f2de651
7 changed files with 84 additions and 116 deletions

View File

@@ -27,6 +27,7 @@ class HomeCaptainController extends GetxController {
String totalMoneyInSEFER = '0';
String totalDurationToday = '0';
Timer? timer;
late LatLng myLocation;
String totalPoints = '0';
String countRefuse = '0';
bool mapType = false;
@@ -146,7 +147,7 @@ class HomeCaptainController extends GetxController {
mapHomeCaptaiController = controller;
controller.getVisibleRegion();
controller.animateCamera(
CameraUpdate.newLatLng(locationController.myLocation),
CameraUpdate.newLatLng(Get.find<LocationController>().myLocation),
);
update();
}
@@ -181,6 +182,8 @@ class HomeCaptainController extends GetxController {
@override
void onInit() async {
await addToken();
// await Get.find<LocationController>().getLocation();
onButtonSelected();
getPaymentToday();
getAllPayment();
@@ -188,6 +191,7 @@ class HomeCaptainController extends GetxController {
onMapCreated(mapHomeCaptaiController!);
getRefusedOrderByCaptain();
totalPoints = Get.find<CaptainWalletController>().totalPoints;
// LocationController().getLocation();
super.onInit();
}

View File

@@ -73,13 +73,13 @@ class MapDriverController extends GetxController {
String? mapAPIKEY;
final zones = <Zone>[];
void onMapCreated(GoogleMapController controller) {
LocationController locationController = Get.find<LocationController>();
myLocation = locationController.myLocation;
void onMapCreated(GoogleMapController controller) async {
myLocation = Get.find<LocationController>().location as LatLng;
myLocation = myLocation;
mapController = controller;
controller.getVisibleRegion();
controller.animateCamera(
CameraUpdate.newLatLngZoom(myLocation, 17),
CameraUpdate.newLatLng(myLocation),
);
update();
@@ -442,6 +442,7 @@ 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'];