added refresh
This commit is contained in:
@ -553,7 +553,23 @@ class DestinationController extends GetxController {
|
||||
void onReady() {
|
||||
Get.toNamed(AppPages.LOGIN)!.then((value){
|
||||
if(indexController.currentUser.length > 0) {
|
||||
String _token = indexController.currentUser[0]["token"];
|
||||
fixMapBound();
|
||||
}
|
||||
else {
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
PerfectureService.getSubExt("9").then((value){
|
||||
if(value != null){
|
||||
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
|
||||
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
void fixMapBound(){
|
||||
String _token = indexController.currentUser[0]["token"];
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
LocationService.getLocationsExt(_token).then((value) {
|
||||
if(value != null){
|
||||
@ -568,18 +584,6 @@ class DestinationController extends GetxController {
|
||||
indexController.loadLocationsBound();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
PerfectureService.getSubExt("9").then((value){
|
||||
if(value != null){
|
||||
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
|
||||
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
void connectionChanged(String val) {
|
||||
|
||||
Reference in New Issue
Block a user