This commit is contained in:
Mohamed Nouffer
2022-07-28 19:01:45 +05:30
parent 16cf0e1434
commit a4adf24e99
6 changed files with 53 additions and 17 deletions

View File

@ -6,6 +6,7 @@ import 'package:get/get.dart';
import 'package:latlong2/latlong.dart'; import 'package:latlong2/latlong.dart';
import 'package:rogapp/pages/destination/destination_controller.dart'; import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/destination_map/destination_map_page.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/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart'; import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/widgets/destination_widget.dart'; import 'package:rogapp/widgets/destination_widget.dart';
@ -64,6 +65,7 @@ class _DestinationPageState extends State<DestinationPage> {
return false; return false;
}, },
child: Scaffold( child: Scaffold(
drawer: const DrawerPage(),
bottomNavigationBar: BottomAppBar( bottomNavigationBar: BottomAppBar(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

View File

@ -85,27 +85,49 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
List<Marker>? getMarkers() { List<Marker>? getMarkers() {
List<Marker> pts = []; List<Marker> 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}"); //print("-----lat ${lat}, ----- lon ${lan}");
Marker m = Marker( Marker m = Marker(
point: LatLng(d.lat!, d.lon!), point: LatLng(d.lat!, d.lon!),
anchorPos: AnchorPos.align(AnchorAlign.center), anchorPos: AnchorPos.align(AnchorAlign.center),
builder:(cts){ builder:(cts){
return Container( return InkWell(
color: Colors.transparent, onTap: (){
child: new Container( print("-- Destination is --- ${d.name} ------");
decoration: new BoxDecoration( if(d != null){
color: Colors.red, if(indexController.currentDestinationFeature.length > 0) {
borderRadius: new BorderRadius.only( indexController.currentDestinationFeature.clear();
topLeft: const Radius.circular(40.0), }
topRight: const Radius.circular(40.0), indexController.currentDestinationFeature.add(d);
) //indexController.getAction();
),
child: new Center( showModalBottomSheet(context: context, isScrollControlled: true,
child: new Text("Hi modal sheet"), //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 Icon(Icons.pin_drop);
// return IconButton( // return IconButton(

View File

@ -42,6 +42,8 @@ class IndexController extends GetxController {
var is_mapController_loaded = false.obs; var is_mapController_loaded = false.obs;
var is_rog_mapcontroller_loaded = false.obs; var is_rog_mapcontroller_loaded = false.obs;
var is_custom_area_selected = false.obs;
MapController? mapController; MapController? mapController;
MapController? rogMapController; MapController? rogMapController;
@ -385,6 +387,9 @@ void login(String email, String password, BuildContext context){
} }
void loadLocationsBound(){ void loadLocationsBound(){
if(is_custom_area_selected.value == true){
return;
}
String cat = currentCat.isNotEmpty ? currentCat[0] : ""; String cat = currentCat.isNotEmpty ? currentCat[0] : "";
LatLngBounds bounds = mapController!.bounds!; LatLngBounds bounds = mapController!.bounds!;
currentBound.clear(); currentBound.clear();

View File

@ -28,7 +28,7 @@ class IndexPage extends GetView<IndexController> {
return false; return false;
}, },
child: Scaffold( child: Scaffold(
drawer: const DrawerPage(), //drawer: const DrawerPage(),
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),

View File

@ -116,6 +116,9 @@ class LocationService{
static Future<GeoJsonFeatureCollection?> loadCustomLocations(String name, String cat) async { static Future<GeoJsonFeatureCollection?> loadCustomLocations(String name, String cat) async {
String url = ""; String url = "";
if(cat == "-all-"){
cat = "";
}
String server_url = ConstValues.currentServer(); String server_url = ConstValues.currentServer();
print("cat is ----- ${cat}"); print("cat is ----- ${cat}");
if(cat.isNotEmpty){ if(cat.isNotEmpty){

View File

@ -157,12 +157,16 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
), ),
onChanged: (String? newValue) { onChanged: (String? newValue) {
if (isNumeric(newValue!)){ if (isNumeric(newValue!)){
widget.indexController.is_custom_area_selected.value = false;
} }
else{ else{
widget.indexController.loadCustomLocation(newValue); widget.indexController.loadCustomLocation(newValue);
widget.indexController.is_custom_area_selected.value = true;
widget.indexController.subPerfs.clear();
widget.indexController.cats.clear();
} }
setState(() { setState(() {
widget.indexController.locations.clear();
if(newValue != null){ if(newValue != null){
widget.indexController.is_loading.value = true; widget.indexController.is_loading.value = true;
widget.indexController.areaDropdownValue = newValue; widget.indexController.areaDropdownValue = newValue;