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);
}, }),),
tooltip: 'Increment', ],
child: const Icon(Icons.document_scanner), ),
elevation: 4.0, ),
), floatingActionButton: FloatingActionButton(
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, onPressed: (){
body: SafeArea( indexController.toggleMode();
child: Column( if(indexController.currentCat.isNotEmpty){
children: [ print(indexController.currentCat[0].toString());
Container( }
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft, },
height: 50.0, tooltip: 'Increment',
child: SingleChildScrollView( child: const Icon(Icons.document_scanner),
scrollDirection: Axis.horizontal, elevation: 4.0,
child: Obx(() => ),
Row( floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
mainAxisAlignment: MainAxisAlignment.spaceBetween, body: SafeArea(
children: [ child: Column(
indexController.is_mapController_loaded.value == false ? children: [
Center(child: CircularProgressIndicator()) Container(
: padding: const EdgeInsets.symmetric(horizontal: 16.0),
BreadCrumbWidget(mapController: indexController.mapController), alignment: Alignment.centerLeft,
Container(width: 24.0,), height: 50.0,
Row( child: SingleChildScrollView(
children: [ scrollDirection: Axis.horizontal,
indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""), child: Obx(() =>
indexController.currentCat.isNotEmpty ? Row(
IconButton( mainAxisAlignment: MainAxisAlignment.spaceBetween,
onPressed: (){ children: [
indexController.currentCat.clear(); indexController.is_mapController_loaded.value == false ?
indexController.loadLocationsBound(); Center(child: CircularProgressIndicator())
}, :
icon: Icon(Icons.cancel, color: Colors.red,) BreadCrumbWidget(mapController: indexController.mapController),
) : Container(width: 24.0,),
Container(width: 0, height: 0,) Row(
], children: [
) indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""),
], indexController.currentCat.isNotEmpty ?
) IconButton(
onPressed: (){
indexController.currentCat.clear();
indexController.loadLocationsBound();
},
icon: Icon(Icons.cancel, color: Colors.red,)
) :
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) {
@ -349,37 +359,36 @@ class BottomSheetNew extends GetView<BottomSheetController> {
Row( Row(
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: (){
onPressed: (){ GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint; LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
Destination dest = Destination( Destination dest = Destination(
name: indexController.currentFeature[0].properties!["location_name"], name: indexController.currentFeature[0].properties!["location_name"],
address: indexController.currentFeature[0].properties!["address"], address: indexController.currentFeature[0].properties!["address"],
phone: indexController.currentFeature[0].properties!["phone"], phone: indexController.currentFeature[0].properties!["phone"],
email: indexController.currentFeature[0].properties!["email"], email: indexController.currentFeature[0].properties!["email"],
webcontents: indexController.currentFeature[0].properties!["webcontents"], webcontents: indexController.currentFeature[0].properties!["webcontents"],
videos: indexController.currentFeature[0].properties!["videos"], videos: indexController.currentFeature[0].properties!["videos"],
category: indexController.currentFeature[0].properties!["category"], category: indexController.currentFeature[0].properties!["category"],
series: 1, series: 1,
lat: pt.latitude, lat: pt.latitude,
lon: pt.longitude, lon: pt.longitude,
location_id: indexController.currentFeature[0].properties!["location_id"], location_id: indexController.currentFeature[0].properties!["location_id"],
list_order: 1, list_order: 1,
photos: indexController.currentFeature[0].properties!["photos"], photos: indexController.currentFeature[0].properties!["photos"],
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"], checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0, auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0,
selected: false, selected: false,
checkedin: false checkedin: false
); );
destinationController.addDestinations(dest); destinationController.addDestinations(dest);
}, },
): ):
Container(), Container(),
SizedBox(width: 8.0,) , SizedBox(width: 8.0,) ,
Obx((() => Obx((() =>