added refresh
This commit is contained in:
@ -553,6 +553,22 @@ class DestinationController extends GetxController {
|
|||||||
void onReady() {
|
void onReady() {
|
||||||
Get.toNamed(AppPages.LOGIN)!.then((value){
|
Get.toNamed(AppPages.LOGIN)!.then((value){
|
||||||
if(indexController.currentUser.length > 0) {
|
if(indexController.currentUser.length > 0) {
|
||||||
|
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"];
|
String _token = indexController.currentUser[0]["token"];
|
||||||
indexController.switchPage(AppPages.INITIAL);
|
indexController.switchPage(AppPages.INITIAL);
|
||||||
LocationService.getLocationsExt(_token).then((value) {
|
LocationService.getLocationsExt(_token).then((value) {
|
||||||
@ -569,18 +585,6 @@ class DestinationController extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
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) {
|
void connectionChanged(String val) {
|
||||||
print('----- %%%%%%%%%%%%%%%%%%%%% ----- ${val}');
|
print('----- %%%%%%%%%%%%%%%%%%%%% ----- ${val}');
|
||||||
|
|||||||
@ -39,6 +39,12 @@ class IndexPage extends GetView<IndexController> {
|
|||||||
//automaticallyImplyLeading: false,
|
//automaticallyImplyLeading: false,
|
||||||
title: Text("add_location".tr),
|
title: Text("add_location".tr),
|
||||||
actions: [
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: (){
|
||||||
|
destinationController.fixMapBound();
|
||||||
|
},
|
||||||
|
icon: Icon(Icons.refresh)
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: (){
|
onTap: (){
|
||||||
Get.toNamed(AppPages.SEARCH);
|
Get.toNamed(AppPages.SEARCH);
|
||||||
|
|||||||
Reference in New Issue
Block a user