update
This commit is contained in:
@ -241,7 +241,27 @@ void login(String email, String password, BuildContext context){
|
||||
CatService.loadCats(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude).then((value) {
|
||||
cats.clear();
|
||||
cats.add(initVal);
|
||||
cats.addAll(value!);
|
||||
for(dynamic cat in value!){
|
||||
if(cat['category'] != null){
|
||||
cats.add(cat!);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void loadCatForCity(String city){
|
||||
dynamic initVal = {'category':'-all-'};
|
||||
LatLngBounds bounds = mapController!.bounds!;
|
||||
if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){
|
||||
CatService.loadCatByCity(city).then((value) {
|
||||
cats.clear();
|
||||
cats.add(initVal);
|
||||
for(dynamic cat in value!){
|
||||
if(cat['category'] != null){
|
||||
cats.add(cat!);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -338,7 +358,9 @@ void login(String email, String password, BuildContext context){
|
||||
|
||||
void loadLocationforSubPerf(String subperf, MapController mapController) async {
|
||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
||||
print(currentCat);
|
||||
if(currentCat[0] == "-all-"){
|
||||
cat = "";
|
||||
}
|
||||
LocationService.loadLocationsSubFor(subperf, cat).then((value){
|
||||
locations.clear();
|
||||
locations.add(value!);
|
||||
@ -419,6 +441,8 @@ void login(String email, String password, BuildContext context){
|
||||
}
|
||||
|
||||
void zoomtoSubPerf(String id){
|
||||
|
||||
print("zooooom");
|
||||
|
||||
PerfectureService.getSubExt(id).then((value){
|
||||
LatLng lat1 = LatLng(value![1], value[0]);
|
||||
@ -439,7 +463,7 @@ void login(String email, String password, BuildContext context){
|
||||
}
|
||||
|
||||
void populateForSubPerf(String subperf, MapController mapController){
|
||||
subDropdownValue = subperf;
|
||||
//subDropdownValue = subperf;
|
||||
loadLocationforSubPerf(subperf, mapController);
|
||||
zoomtoSubPerf(subperf);
|
||||
is_loading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user