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

@ -2,6 +2,8 @@ PODS:
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_compass (0.0.1): - flutter_compass (0.0.1):
- Flutter - Flutter
- flutter_keyboard_visibility (0.0.1):
- Flutter
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
@ -30,6 +32,7 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_compass (from `.symlinks/plugins/flutter_compass/ios`) - flutter_compass (from `.symlinks/plugins/flutter_compass/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
@ -48,6 +51,8 @@ EXTERNAL SOURCES:
:path: Flutter :path: Flutter
flutter_compass: flutter_compass:
:path: ".symlinks/plugins/flutter_compass/ios" :path: ".symlinks/plugins/flutter_compass/ios"
flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
geolocator_apple: geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios" :path: ".symlinks/plugins/geolocator_apple/ios"
google_maps_flutter: google_maps_flutter:
@ -66,6 +71,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855 flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
google_maps_flutter: c59fc576c0d0c7f4dc4bd63832c862d22d5a7c6d google_maps_flutter: c59fc576c0d0c7f4dc4bd63832c862d22d5a7c6d

View File

@ -22,119 +22,113 @@ class IndexPage extends GetView<IndexController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return WillPopScope(
drawer: const DrawerPage(), onWillPop: () async {
appBar: AppBar( indexController.switchPage(AppPages.INITIAL);
leading: IconButton( return false;
icon: Icon(Icons.arrow_back_ios), },
onPressed: (){ child: Scaffold(
indexController.switchPage(AppPages.TRAVEL); drawer: const DrawerPage(),
}, appBar: AppBar(
), leading: IconButton(
//automaticallyImplyLeading: false, icon: Icon(Icons.arrow_back_ios),
title: Text("Add locations"), onPressed: (){
actions: [ indexController.switchPage(AppPages.TRAVEL);
InkWell( },
onTap: (){ ),
Get.toNamed(AppPages.SEARCH); //automaticallyImplyLeading: false,
}, title: Text("Add locations"),
child: Container( actions: [
height: 32, InkWell(
width: 75, onTap: (){
decoration: BoxDecoration( Get.toNamed(AppPages.SEARCH);
color: Colors.blue, },
borderRadius: BorderRadius.circular(25), child: Container(
height: 32,
width: 75,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(25),
),
child: const Center(child: Icon(Icons.search),),
),
), ),
child: const Center(child: Icon(Icons.search),), CatWidget(indexController: indexController,),
),
),
// RaisedButton(
// child: Text("db"),
// onPressed: (){
// DatabaseHelper db = DatabaseHelper.instance;
// db.getDestinations().then((value){
// print("-------- lendth in db ${value.length} ---- :::::");
// for(Destination d in value){
// print("-------- values in db are ${d.checkedin} ---- :::::");
// };
// });
// },
// ),
CatWidget(indexController: indexController,),
],
),
bottomNavigationBar: BottomAppBar(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),),
const Expanded(child: Text('')),
Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){
indexController.switchPage(AppPages.TRAVEL);
}),),
], ],
), ),
), bottomNavigationBar: BottomAppBar(
floatingActionButton: FloatingActionButton( child: Row(
onPressed: (){ mainAxisAlignment: MainAxisAlignment.center,
indexController.toggleMode(); children: <Widget>[
if(indexController.currentCat.isNotEmpty){ Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),),
print(indexController.currentCat[0].toString()); const Expanded(child: Text('')),
} Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){
indexController.switchPage(AppPages.TRAVEL);
}),),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
indexController.toggleMode();
if(indexController.currentCat.isNotEmpty){
print(indexController.currentCat[0].toString());
}
}, },
tooltip: 'Increment', tooltip: 'Increment',
child: const Icon(Icons.document_scanner), child: const Icon(Icons.document_scanner),
elevation: 4.0, elevation: 4.0,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea( body: SafeArea(
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 50.0, height: 50.0,
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Obx(() => child: Obx(() =>
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
indexController.is_mapController_loaded.value == false ? indexController.is_mapController_loaded.value == false ?
Center(child: CircularProgressIndicator()) Center(child: CircularProgressIndicator())
: :
BreadCrumbWidget(mapController: indexController.mapController), BreadCrumbWidget(mapController: indexController.mapController),
Container(width: 24.0,), Container(width: 24.0,),
Row( Row(
children: [ children: [
indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""), indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""),
indexController.currentCat.isNotEmpty ? indexController.currentCat.isNotEmpty ?
IconButton( IconButton(
onPressed: (){ onPressed: (){
indexController.currentCat.clear(); indexController.currentCat.clear();
indexController.loadLocationsBound(); indexController.loadLocationsBound();
}, },
icon: Icon(Icons.cancel, color: Colors.red,) icon: Icon(Icons.cancel, color: Colors.red,)
) : ) :
Container(width: 0, height: 0,) Container(width: 0, height: 0,)
], ],
) )
], ],
) )
),
), ),
), ),
), Expanded(
Expanded( child: Obx(() =>
child: Obx(() => indexController.mode == 0 ?
indexController.mode == 0 ? MapWidget() :
MapWidget() : ListWidget(),
ListWidget(), )
)
) )
], ],
),
), ),
), ),
); );

View File

@ -58,6 +58,16 @@ class BottomSheetNew extends GetView<BottomSheetController> {
if (!await launch(url)) throw 'Could not launch $url'; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -350,36 +360,35 @@ class BottomSheetNew extends GetView<BottomSheetController> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
indexController.rog_mode == 0 ? indexController.rog_mode == 0 ?
IconButton( IconButton(
icon: Icon(Icons.pin_drop_sharp, size: 32,), 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);
onPressed: (){ Destination dest = Destination(
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint; name: indexController.currentFeature[0].properties!["location_name"],
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude); address: indexController.currentFeature[0].properties!["address"],
phone: indexController.currentFeature[0].properties!["phone"],
Destination dest = Destination( email: indexController.currentFeature[0].properties!["email"],
name: indexController.currentFeature[0].properties!["location_name"], webcontents: indexController.currentFeature[0].properties!["webcontents"],
address: indexController.currentFeature[0].properties!["address"], videos: indexController.currentFeature[0].properties!["videos"],
phone: indexController.currentFeature[0].properties!["phone"], category: indexController.currentFeature[0].properties!["category"],
email: indexController.currentFeature[0].properties!["email"], series: 1,
webcontents: indexController.currentFeature[0].properties!["webcontents"], lat: pt.latitude,
videos: indexController.currentFeature[0].properties!["videos"], lon: pt.longitude,
category: indexController.currentFeature[0].properties!["category"], location_id: indexController.currentFeature[0].properties!["location_id"],
series: 1, list_order: 1,
lat: pt.latitude, photos: indexController.currentFeature[0].properties!["photos"],
lon: pt.longitude, checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
location_id: indexController.currentFeature[0].properties!["location_id"], auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0,
list_order: 1, selected: false,
photos: indexController.currentFeature[0].properties!["photos"], checkedin: false
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"], );
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0, destinationController.addDestinations(dest);
selected: false, },
checkedin: false ):
); Container(),
destinationController.addDestinations(dest);
},
):
Container(),
SizedBox(width: 8.0,) , SizedBox(width: 8.0,) ,
Obx((() => Obx((() =>