manage show input
This commit is contained in:
parent
f267e3ede9
commit
e4836ac4eb
@ -268,6 +268,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
if (suggestions.isNotEmpty) {
|
||||
showArrow = false;
|
||||
showInputSearch = false;
|
||||
showInputTag = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -468,6 +469,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
showInputSearch =
|
||||
true; // Optionally clear suggestions
|
||||
/// Clear the filtered posts
|
||||
showInputTag = true;
|
||||
});
|
||||
fetchPostsByLocation();
|
||||
},
|
||||
@ -489,6 +491,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
suggestions.clear(); // Optionally clear suggestions
|
||||
showArrow = true;
|
||||
showInputSearch = true;
|
||||
showInputTag = true;
|
||||
|
||||
/// Clear the filted posts
|
||||
});
|
||||
@ -521,6 +524,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
suggestions.clear();
|
||||
showArrow = true;
|
||||
showInputSearch = true;
|
||||
showInputTag = true;
|
||||
});
|
||||
SharedPreferences prefs =
|
||||
await SharedPreferences.getInstance();
|
||||
@ -553,11 +557,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
inputItem.clear();
|
||||
itemName = ''; // Reset the geographical zone state
|
||||
suggestionsItem.clear();
|
||||
showDateFields = true;
|
||||
showArrow = true;
|
||||
inputTags.clear();
|
||||
});
|
||||
fetchPostsByLocation();
|
||||
},
|
||||
@ -565,17 +565,9 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
),
|
||||
onChanged: (value) {
|
||||
if (value.isNotEmpty) {
|
||||
setState(() {
|
||||
itemName = value;
|
||||
searchSuggestionsByItem(value);
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
showDateFields = true;
|
||||
showArrow = true; // Optionally clear suggestions
|
||||
inputItem.clear(); // Clear the text field
|
||||
itemName = ''; // Reset the geographical zone state
|
||||
suggestionsItem.clear();
|
||||
inputTags.clear(); // Clear the text field
|
||||
|
||||
/// Clear the filted posts
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user