update
This commit is contained in:
@ -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<DestinationPage> {
|
||||
return false;
|
||||
},
|
||||
child: Scaffold(
|
||||
drawer: const DrawerPage(),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@ -85,27 +85,49 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
|
||||
|
||||
List<Marker>? getMarkers() {
|
||||
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}");
|
||||
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(
|
||||
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,
|
||||
borderRadius: new BorderRadius.only(
|
||||
topLeft: const Radius.circular(40.0),
|
||||
topRight: const Radius.circular(40.0),
|
||||
)
|
||||
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("Hi modal sheet"),
|
||||
)
|
||||
));
|
||||
child: new Text(
|
||||
(i + 1).toString(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
//return Icon(Icons.pin_drop);
|
||||
// return IconButton(
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -28,7 +28,7 @@ class IndexPage extends GetView<IndexController> {
|
||||
return false;
|
||||
},
|
||||
child: Scaffold(
|
||||
drawer: const DrawerPage(),
|
||||
//drawer: const DrawerPage(),
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios),
|
||||
|
||||
@ -116,6 +116,9 @@ class LocationService{
|
||||
|
||||
static Future<GeoJsonFeatureCollection?> loadCustomLocations(String name, String cat) async {
|
||||
String url = "";
|
||||
if(cat == "-all-"){
|
||||
cat = "";
|
||||
}
|
||||
String server_url = ConstValues.currentServer();
|
||||
print("cat is ----- ${cat}");
|
||||
if(cat.isNotEmpty){
|
||||
|
||||
@ -157,12 +157,16 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
),
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user