This commit is contained in:
Hamza-Ayed
2024-05-11 00:58:11 +03:00
parent b473a9ce09
commit 750d980fcb
38 changed files with 329 additions and 1814 deletions

View File

@@ -164,7 +164,17 @@ class HomeCaptainController extends GetxController {
update();
}
late GoogleMapController mapHomeCaptainController;
// late GoogleMapController mapHomeCaptainController;
// void onMapCreated(GoogleMapController controller) {
// mapHomeCaptainController = controller;
// controller.getVisibleRegion();
// // Animate camera to user location (optional)
// controller.animateCamera(
// CameraUpdate.newLatLng(Get.find<LocationController>().myLocation),
// );
// }
GoogleMapController? mapHomeCaptainController; // Initialize to null
void onMapCreated(GoogleMapController controller) {
mapHomeCaptainController = controller;
controller.getVisibleRegion();
@@ -221,7 +231,7 @@ class HomeCaptainController extends GetxController {
getCountRideToday();
getAllPayment();
startPeriodicExecution();
onMapCreated(mapHomeCaptainController);
onMapCreated(mapHomeCaptainController!);
totalPoints = Get.find<CaptainWalletController>().totalPoints;
getRefusedOrderByCaptain();
// LocationController().getLocation();

View File

@@ -44,18 +44,14 @@ class CaptainWalletController extends GetxController {
payload: {'driverID': box.read(BoxName.driverID)},
);
walletDate = jsonDecode(res);
totalAmount = walletDate['message'][0]['total_amount'].toString() == null
? '0'
: walletDate['message'][0]['total_amount'];
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'].toString() == null
? '0'
: walletDateVisa['message'][0]['diff'];
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
print(totalAmountVisa);
isLoading = false;
update();

View File

@@ -47,7 +47,7 @@ class SplashScreenController extends GetxController
Timer(const Duration(seconds: 4), () {
box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage())
: box.read(BoxName.dobDriver) != null
: box.read(BoxName.emailDriver) != null
? Get.off(() => HomeCaptain())
: Get.off(() => LoginCaptin());
});