change modes

This commit is contained in:
Mohamed Nouffer
2022-07-09 22:51:34 +05:30
parent 131a8995e0
commit ce105a6754
22 changed files with 828 additions and 293 deletions

View File

@ -38,18 +38,18 @@ class _DestinationPageState extends State<DestinationPage> {
}
Image getImage(int index){
if(destinationController.destinations[index]["location"]["properties"]["photos"] == null || destinationController.destinations[index]["location"]["properties"]["photos"] == ""){
if(destinationController.destinations[index].photos == null || destinationController.destinations[index].photos == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
return Image(image: NetworkImage(destinationController.destinations[index]["location"]["properties"]["photos"]));
return Image(image: NetworkImage(destinationController.destinations[index].photos!));
}
}
@override
void initState() {
destinationController.context = context;
destinationController.PopulateDestinations();
//destinationController.context = context;
//destinationController.PopulateDestinations();
super.initState();
}
@ -71,12 +71,7 @@ class _DestinationPageState extends State<DestinationPage> {
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);
}
indexController.switchPage(AppPages.INITIAL);
}),),
],
),
@ -92,13 +87,8 @@ class _DestinationPageState extends State<DestinationPage> {
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
appBar:AppBar(
title: Text("Iternery"),
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),
onPressed: (){
indexController.switchPage(AppPages.INITIAL);
},
),
automaticallyImplyLeading: false,
title: Text("app_title".tr),
actions: [
ToggleButtons(
disabledColor: Colors.grey.shade200,