80 lines
2.8 KiB
Dart
80 lines
2.8 KiB
Dart
import 'dart:developer';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:rogapp/pages/destination/destination_controller.dart';
|
|
import 'package:rogapp/pages/destination_map/destination_map_page.dart';
|
|
import 'package:rogapp/pages/index/index_controller.dart';
|
|
import 'package:rogapp/routes/app_pages.dart';
|
|
import 'package:rogapp/widgets/destination_widget.dart';
|
|
import 'package:timeline_tile/timeline_tile.dart';
|
|
|
|
|
|
class DestinationPage extends StatefulWidget {
|
|
DestinationPage({ Key? key }) : super(key: key);
|
|
|
|
@override
|
|
State<DestinationPage> createState() => _DestinationPageState();
|
|
}
|
|
|
|
class _DestinationPageState extends State<DestinationPage> {
|
|
final DestinationController destinationController = Get.find<DestinationController>();
|
|
|
|
final IndexController indexController = Get.find<IndexController>();
|
|
|
|
final List<int> _items = List<int>.generate(50, (int index) => index);
|
|
|
|
Image getImage(int index){
|
|
if(destinationController.destinations[index]["location"]["properties"]["photos"] == null || destinationController.destinations[index]["location"]["properties"]["photos"] == ""){
|
|
return Image(image: AssetImage('assets/images/empty_image.png'));
|
|
}
|
|
else{
|
|
return Image(image: NetworkImage(destinationController.destinations[index]["location"]["properties"]["photos"]));
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
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);
|
|
}
|
|
}),),
|
|
],
|
|
),
|
|
),
|
|
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"),
|
|
),
|
|
body: Obx(() =>
|
|
indexController.desination_mode.value == 0 ?
|
|
DestinationWidget():
|
|
DestinationMapPage()
|
|
)
|
|
);
|
|
|
|
}
|
|
} |