update
This commit is contained in:
@ -103,6 +103,8 @@ class DestinationController extends GetxController {
|
||||
void onInit() {
|
||||
PopulateDestinations();
|
||||
|
||||
print("------ in iniit");
|
||||
|
||||
|
||||
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
@ -165,7 +167,7 @@ class DestinationController extends GetxController {
|
||||
void PopulateDestinations(){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
int user_id = indexController.currentUser[0]["user"]["id"];
|
||||
//print(user_id);
|
||||
print(user_id);
|
||||
DestinationService.getDestinations(user_id).then((value){
|
||||
|
||||
MatrixService.getDestinations(value).then((mat){
|
||||
|
||||
@ -57,67 +57,73 @@ class _DestinationPageState extends State<DestinationPage> {
|
||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||
final Color oddItemColor = colorScheme.primary.withOpacity(0.05);
|
||||
final Color evenItemColor = colorScheme.primary.withOpacity(0.15);
|
||||
return Scaffold(
|
||||
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: (){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
}
|
||||
else{
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
}
|
||||
}),),
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
return false;
|
||||
},
|
||||
child: Scaffold(
|
||||
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: (){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
}
|
||||
else{
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
}
|
||||
}),),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: (){
|
||||
//print("######");
|
||||
indexController.toggleDestinationMode();
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
child: const Icon(Icons.document_scanner),
|
||||
elevation: 4.0,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
appBar:AppBar(
|
||||
title: Text("Iternery"),
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios),
|
||||
onPressed: (){
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
ToggleButtons(
|
||||
disabledColor: Colors.grey.shade200,
|
||||
selectedColor: Colors.red,
|
||||
children: <Widget>[
|
||||
Icon(Icons.explore
|
||||
)],
|
||||
onPressed: (int index) {
|
||||
setState(() {
|
||||
destinationController.isSelected[index] = !destinationController.isSelected[index];
|
||||
});
|
||||
},
|
||||
isSelected: destinationController.isSelected,
|
||||
),
|
||||
IconButton(onPressed: (){
|
||||
showCurrentPosition();
|
||||
},
|
||||
icon: Icon(Icons.location_on_outlined))
|
||||
],
|
||||
),
|
||||
body: Obx(() =>
|
||||
indexController.desination_mode.value == 0 ?
|
||||
DestinationWidget():
|
||||
DestinationMapPage()
|
||||
)
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: (){
|
||||
//print("######");
|
||||
indexController.toggleDestinationMode();
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
child: const Icon(Icons.document_scanner),
|
||||
elevation: 4.0,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
appBar:AppBar(
|
||||
title: Text("Iternery"),
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios),
|
||||
onPressed: (){
|
||||
indexController.switchPage(AppPages.INITIAL);
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
ToggleButtons(
|
||||
disabledColor: Colors.grey.shade200,
|
||||
selectedColor: Colors.red,
|
||||
children: <Widget>[
|
||||
Icon(Icons.explore
|
||||
)],
|
||||
onPressed: (int index) {
|
||||
setState(() {
|
||||
destinationController.isSelected[index] = !destinationController.isSelected[index];
|
||||
});
|
||||
},
|
||||
isSelected: destinationController.isSelected,
|
||||
),
|
||||
IconButton(onPressed: (){
|
||||
showCurrentPosition();
|
||||
},
|
||||
icon: Icon(Icons.location_on_outlined))
|
||||
],
|
||||
),
|
||||
body: Obx(() =>
|
||||
indexController.desination_mode.value == 0 ?
|
||||
DestinationWidget():
|
||||
DestinationMapPage()
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user