This commit is contained in:
Mohamed Nouffer
2022-07-22 19:36:04 +05:30
parent 7c89519ddf
commit ab6fc3df5c
3 changed files with 146 additions and 137 deletions

View File

@ -58,6 +58,16 @@ class BottomSheetNew extends GetView<BottomSheetController> {
if (!await launch(url)) throw 'Could not launch $url';
}
bool isInDestination(String locationid){
int lid = int.parse(locationid);
if(destinationController.destinations.where((element) => element.location_id == lid).length > 0){
return true;
}
else{
return false;
}
}
@override
Widget build(BuildContext context) {
@ -349,37 +359,36 @@ class BottomSheetNew extends GetView<BottomSheetController> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
indexController.rog_mode == 0 ?
IconButton(
icon: Icon(Icons.pin_drop_sharp, size: 32,),
onPressed: (){
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
indexController.rog_mode == 0 ?
IconButton(
icon: Icon(Icons.pin_drop_sharp, size: 32,),
onPressed: (){
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
Destination dest = Destination(
name: indexController.currentFeature[0].properties!["location_name"],
address: indexController.currentFeature[0].properties!["address"],
phone: indexController.currentFeature[0].properties!["phone"],
email: indexController.currentFeature[0].properties!["email"],
webcontents: indexController.currentFeature[0].properties!["webcontents"],
videos: indexController.currentFeature[0].properties!["videos"],
category: indexController.currentFeature[0].properties!["category"],
series: 1,
lat: pt.latitude,
lon: pt.longitude,
location_id: indexController.currentFeature[0].properties!["location_id"],
list_order: 1,
photos: indexController.currentFeature[0].properties!["photos"],
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0,
selected: false,
checkedin: false
);
destinationController.addDestinations(dest);
},
):
Container(),
Destination dest = Destination(
name: indexController.currentFeature[0].properties!["location_name"],
address: indexController.currentFeature[0].properties!["address"],
phone: indexController.currentFeature[0].properties!["phone"],
email: indexController.currentFeature[0].properties!["email"],
webcontents: indexController.currentFeature[0].properties!["webcontents"],
videos: indexController.currentFeature[0].properties!["videos"],
category: indexController.currentFeature[0].properties!["category"],
series: 1,
lat: pt.latitude,
lon: pt.longitude,
location_id: indexController.currentFeature[0].properties!["location_id"],
list_order: 1,
photos: indexController.currentFeature[0].properties!["photos"],
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0,
selected: false,
checkedin: false
);
destinationController.addDestinations(dest);
},
):
Container(),
SizedBox(width: 8.0,) ,
Obx((() =>