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

@ -22,119 +22,113 @@ class IndexPage extends GetView<IndexController> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: const DrawerPage(),
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: (){
indexController.switchPage(AppPages.TRAVEL);
},
),
//automaticallyImplyLeading: false,
title: Text("Add locations"),
actions: [
InkWell(
onTap: (){
Get.toNamed(AppPages.SEARCH);
},
child: Container(
height: 32,
width: 75,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(25),
return WillPopScope(
onWillPop: () async {
indexController.switchPage(AppPages.INITIAL);
return false;
},
child: Scaffold(
drawer: const DrawerPage(),
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: (){
indexController.switchPage(AppPages.TRAVEL);
},
),
//automaticallyImplyLeading: false,
title: Text("Add locations"),
actions: [
InkWell(
onTap: (){
Get.toNamed(AppPages.SEARCH);
},
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),),
),
),
// 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);
}),),
CatWidget(indexController: indexController,),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
indexController.toggleMode();
if(indexController.currentCat.isNotEmpty){
print(indexController.currentCat[0].toString());
}
},
tooltip: 'Increment',
child: const Icon(Icons.document_scanner),
elevation: 4.0,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea(
child: Column(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
height: 50.0,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Obx(() =>
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
indexController.is_mapController_loaded.value == false ?
Center(child: CircularProgressIndicator())
:
BreadCrumbWidget(mapController: indexController.mapController),
Container(width: 24.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,)
],
)
],
)
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);
}),),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
indexController.toggleMode();
if(indexController.currentCat.isNotEmpty){
print(indexController.currentCat[0].toString());
}
},
tooltip: 'Increment',
child: const Icon(Icons.document_scanner),
elevation: 4.0,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea(
child: Column(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
alignment: Alignment.centerLeft,
height: 50.0,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Obx(() =>
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
indexController.is_mapController_loaded.value == false ?
Center(child: CircularProgressIndicator())
:
BreadCrumbWidget(mapController: indexController.mapController),
Container(width: 24.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(
child: Obx(() =>
indexController.mode == 0 ?
MapWidget() :
ListWidget(),
Expanded(
child: Obx(() =>
indexController.mode == 0 ?
MapWidget() :
ListWidget(),
)
)
)
],
],
),
),
),
);