update
This commit is contained in:
@ -20,6 +20,7 @@ class IndexController extends GetxController {
|
||||
List<dynamic> perfectures = <dynamic>[].obs;
|
||||
List<LatLngBounds> currentBound = <LatLngBounds>[].obs;
|
||||
List<dynamic> subPerfs = <dynamic>[].obs;
|
||||
List<dynamic> areas = <dynamic>[].obs;
|
||||
List<dynamic> cats = <dynamic>[].obs;
|
||||
|
||||
List<String> currentCat = <String>[].obs;
|
||||
@ -40,6 +41,7 @@ class IndexController extends GetxController {
|
||||
|
||||
String dropdownValue = "9";
|
||||
String subDropdownValue = "-1";
|
||||
String areaDropdownValue = "-1";
|
||||
|
||||
void toggleMode(){
|
||||
if(mode.value==0){
|
||||
@ -72,7 +74,8 @@ class IndexController extends GetxController {
|
||||
if(perfectures.length == 0){
|
||||
PerfectureService.loadPerfectures().then((value){
|
||||
perfectures.add(value);
|
||||
loadSubPerfFor("9");
|
||||
loadAreaFor("9");
|
||||
//loadSubPerfFor("9");
|
||||
});
|
||||
}
|
||||
//loadCats();
|
||||
@ -174,6 +177,19 @@ class IndexController extends GetxController {
|
||||
// }
|
||||
}
|
||||
|
||||
void loadAreaFor(String perf){
|
||||
areas.clear();
|
||||
dynamic initVal = {'id':'-1', 'adm2_ja':'----'};
|
||||
PerfectureService.loadGifuAreas(perf).then((value){
|
||||
print(value);
|
||||
value!.add(initVal);
|
||||
areas.add(value);
|
||||
//loadSubPerfFor("9");
|
||||
//subDropdownValue = getSubInitialVal();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void loadSubPerfFor(String perf){
|
||||
subPerfs.clear();
|
||||
dynamic initVal = {'id':'-1', 'adm2_ja':'----'};
|
||||
@ -219,6 +235,15 @@ class IndexController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
void loadCustomLocation(String customarea, MapController mapController) async {
|
||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
||||
print(currentCat);
|
||||
LocationService.loadCustomLocations(cat).then((value){
|
||||
locations.clear();
|
||||
locations.add(value!);
|
||||
});
|
||||
}
|
||||
|
||||
void loadLocationsBound(){
|
||||
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
||||
LatLngBounds bounds = mapController!.bounds!;
|
||||
@ -287,6 +312,12 @@ class IndexController extends GetxController {
|
||||
is_loading.value = false;
|
||||
}
|
||||
|
||||
void populateForCustomArea(String customarea, MapController mapController){
|
||||
loadCustomLocation("cus", mapController);
|
||||
//zoomtoSubPerf(subperf);
|
||||
is_loading.value = false;
|
||||
}
|
||||
|
||||
|
||||
GeoJsonFeature? getFeatureForLatLong(double lat, double long){
|
||||
if(locations.length > 0){
|
||||
|
||||
@ -26,17 +26,7 @@ class IndexPage extends GetView<IndexController> {
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text("app_title".tr),
|
||||
actions: [
|
||||
ElevatedButton(onPressed: (){}, child: CatWidget(indexController: indexController,)),
|
||||
CatWidget(indexController: indexController,),
|
||||
ElevatedButton(
|
||||
onPressed: () async{
|
||||
PolylinePoints polylinePoints = PolylinePoints();
|
||||
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates("AIzaSyAUBI1ablMKuJwGj2-kSuEhvYxvB1A-mOE", PointLatLng(35.389282, 136.498027), PointLatLng(36.285848, 137.575186));
|
||||
print(result.points);
|
||||
indexController.routePoints = result.points;
|
||||
},
|
||||
child: Text("Google")
|
||||
)
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
|
||||
Reference in New Issue
Block a user