update to init loading

This commit is contained in:
Mohamed Nouffer
2023-01-03 12:00:28 +05:30
parent f8a79842e3
commit d56ed36be5
4 changed files with 18 additions and 6 deletions

View File

@ -514,13 +514,19 @@ class DestinationController extends GetxController {
void onReady() {
Get.toNamed(AppPages.LOGIN)!.then((value){
if(indexController.currentUser.length > 0) {
Get.toNamed(AppPages.INITIAL);
LocationService.getLocationsExt().then((value) {
String _token = indexController.currentUser[0]["token"];
indexController.switchPage(AppPages.INITIAL);
LocationService.getLocationsExt(_token).then((value) {
if(value != null){
print("--- loc ext is - ${value} ----");
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
print("--- bnds is - ${bnds} ----");
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
indexController.mapController!.fitBounds(
bnds,
);
indexController.currentBound.clear();
indexController.currentBound.add(bnds);
indexController.loadLocationsBound();
}
});
}