add suggestion itemé
This commit is contained in:
@@ -44,6 +44,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
List<Events> filteredPosts = [];
|
||||
String geographicalZone = '';
|
||||
String itemName = '';
|
||||
String itemTags = '';
|
||||
String query = '';
|
||||
List<Map<String, dynamic>> suggestions = [];
|
||||
List<Map<String, dynamic>> suggestionsItem = [];
|
||||
@@ -376,8 +377,9 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
suggestionsTags = (data as List)
|
||||
.map((feature) => {'name': feature['name']})
|
||||
.toList();
|
||||
if (suggestionsItem.isNotEmpty) {
|
||||
showDateFields = false;
|
||||
if (suggestionsTags.isNotEmpty) {
|
||||
showInputGeo = false;
|
||||
showInputSearch = false;
|
||||
showArrow = false;
|
||||
}
|
||||
});
|
||||
@@ -602,6 +604,33 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
fetchPostsByLocation();
|
||||
}
|
||||
}),
|
||||
if (suggestionsTags.isNotEmpty)
|
||||
Container(
|
||||
height: 200,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.blue),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: suggestions.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(suggestionsTags[index]['name']),
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
itemTags = suggestionsTags[index]['name'];
|
||||
inputTags.text = itemTags;
|
||||
suggestionsTags.clear();
|
||||
showArrow = true;
|
||||
showInputSearch = true;
|
||||
showInputGeo = true;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user