update for routing
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
|
||||
@ -9,6 +11,7 @@ class ListWidget extends StatelessWidget {
|
||||
ListWidget({ Key? key }) : super(key: key);
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
Image getImage(int index){
|
||||
if(indexController.locations[0].collection[index].properties!["photos"] == null || indexController.locations[0].collection[index].properties!["photos"] == ""){
|
||||
@ -39,8 +42,18 @@ class ListWidget extends StatelessWidget {
|
||||
itemCount: indexController.locations[0].collection.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (_, index){
|
||||
bool _is_found = false;
|
||||
for(Destination d in destinationController.destinations){
|
||||
if(indexController.locations[0].collection[index].properties!['location_id'] == d.location_id){
|
||||
_is_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Card(
|
||||
child: ListTile(
|
||||
selected: _is_found,
|
||||
|
||||
selectedTileColor: Colors.yellow.shade200,
|
||||
onTap: (){
|
||||
GeoJsonFeature gf = indexController.locations[0].collection[index];
|
||||
changeCurrentFeature(gf);
|
||||
@ -54,6 +67,7 @@ class ListWidget extends StatelessWidget {
|
||||
leading: getImage(index),
|
||||
title: indexController.locations[0].collection[index].properties!['location_name'] != null ? Text(indexController.locations[0].collection[index].properties!['location_name'].toString()) : Text(""),
|
||||
subtitle: indexController.locations[0].collection[index].properties!['category'] != null ? Text(indexController.locations[0].collection[index].properties!['category']) : Text(""),
|
||||
trailing: Text(indexController.locations[0].collection[index].properties!['sub_loc_id'] ),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user