diff --git a/lib/pages/destination/destination_page.dart b/lib/pages/destination/destination_page.dart index a6693ee..d905409 100644 --- a/lib/pages/destination/destination_page.dart +++ b/lib/pages/destination/destination_page.dart @@ -6,6 +6,7 @@ import 'package:get/get.dart'; import 'package:latlong2/latlong.dart'; import 'package:rogapp/pages/destination/destination_controller.dart'; import 'package:rogapp/pages/destination_map/destination_map_page.dart'; +import 'package:rogapp/pages/drawer/drawer_page.dart'; import 'package:rogapp/pages/index/index_controller.dart'; import 'package:rogapp/routes/app_pages.dart'; import 'package:rogapp/widgets/destination_widget.dart'; @@ -64,6 +65,7 @@ class _DestinationPageState extends State { return false; }, child: Scaffold( + drawer: const DrawerPage(), bottomNavigationBar: BottomAppBar( child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/destination_map/destination_map_page.dart b/lib/pages/destination_map/destination_map_page.dart index 7a76585..055f65c 100644 --- a/lib/pages/destination_map/destination_map_page.dart +++ b/lib/pages/destination_map/destination_map_page.dart @@ -85,27 +85,49 @@ class _DestinationMapPageState extends State { List? getMarkers() { List pts = []; - for(Destination d in destinationController.destinations){ + int index = -1; + for (int i = 0; i < destinationController.destinations.length; i++) { + Destination d = destinationController.destinations[i]; + //for(Destination d in destinationController.destinations){ //print("-----lat ${lat}, ----- lon ${lan}"); Marker m = Marker( point: LatLng(d.lat!, d.lon!), anchorPos: AnchorPos.align(AnchorAlign.center), builder:(cts){ - return Container( - color: Colors.transparent, - child: new Container( - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: new BorderRadius.only( - topLeft: const Radius.circular(40.0), - topRight: const Radius.circular(40.0), - ) - ), - child: new Center( - child: new Text("Hi modal sheet"), - ) - )); + return InkWell( + onTap: (){ + print("-- Destination is --- ${d.name} ------"); + if(d != null){ + if(indexController.currentDestinationFeature.length > 0) { + indexController.currentDestinationFeature.clear(); + } + indexController.currentDestinationFeature.add(d); + //indexController.getAction(); + + showModalBottomSheet(context: context, isScrollControlled: true, + //builder:((context) => BottomSheetWidget()) + builder:((context) => BottomSheetNew()) + ); + } + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + border: new Border.all( + color: Colors.white, + width: d.checkin_radious != null ? d.checkin_radious! : 1, + ), + ), + child: new Center( + child: new Text( + (i + 1).toString(), + style: TextStyle(color: Colors.white), + ), + ), + ), + ); //return Icon(Icons.pin_drop); // return IconButton( diff --git a/lib/pages/index/index_controller.dart b/lib/pages/index/index_controller.dart index 33b3adf..bac62a0 100644 --- a/lib/pages/index/index_controller.dart +++ b/lib/pages/index/index_controller.dart @@ -42,6 +42,8 @@ class IndexController extends GetxController { var is_mapController_loaded = false.obs; var is_rog_mapcontroller_loaded = false.obs; + var is_custom_area_selected = false.obs; + MapController? mapController; MapController? rogMapController; @@ -385,6 +387,9 @@ void login(String email, String password, BuildContext context){ } void loadLocationsBound(){ + if(is_custom_area_selected.value == true){ + return; + } String cat = currentCat.isNotEmpty ? currentCat[0] : ""; LatLngBounds bounds = mapController!.bounds!; currentBound.clear(); diff --git a/lib/pages/index/index_page.dart b/lib/pages/index/index_page.dart index 5c1f437..5828388 100644 --- a/lib/pages/index/index_page.dart +++ b/lib/pages/index/index_page.dart @@ -28,7 +28,7 @@ class IndexPage extends GetView { return false; }, child: Scaffold( - drawer: const DrawerPage(), + //drawer: const DrawerPage(), appBar: AppBar( leading: IconButton( icon: Icon(Icons.arrow_back_ios), diff --git a/lib/services/location_service.dart b/lib/services/location_service.dart index 0f4e325..dfb2e06 100644 --- a/lib/services/location_service.dart +++ b/lib/services/location_service.dart @@ -116,6 +116,9 @@ class LocationService{ static Future loadCustomLocations(String name, String cat) async { String url = ""; + if(cat == "-all-"){ + cat = ""; + } String server_url = ConstValues.currentServer(); print("cat is ----- ${cat}"); if(cat.isNotEmpty){ diff --git a/lib/widgets/perfecture_widget.dart b/lib/widgets/perfecture_widget.dart index 4583095..543824f 100644 --- a/lib/widgets/perfecture_widget.dart +++ b/lib/widgets/perfecture_widget.dart @@ -157,12 +157,16 @@ class _PerfectureWidgetState extends State { ), onChanged: (String? newValue) { if (isNumeric(newValue!)){ - + widget.indexController.is_custom_area_selected.value = false; } else{ widget.indexController.loadCustomLocation(newValue); + widget.indexController.is_custom_area_selected.value = true; + widget.indexController.subPerfs.clear(); + widget.indexController.cats.clear(); } setState(() { + widget.indexController.locations.clear(); if(newValue != null){ widget.indexController.is_loading.value = true; widget.indexController.areaDropdownValue = newValue;