Merge pull request 'fix input geo search' (#24) from hotfix/inputgeo into main
Reviewed-on: #24
This commit is contained in:
commit
d012ac409b
@ -420,18 +420,34 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
inputGeo.clear(); // Clear the text field
|
inputGeo.clear(); // Clear the text field
|
||||||
geographicalZone = ''; // Reset the geographical zone state
|
geographicalZone = ''; // Reset the geographical zone state
|
||||||
suggestions.clear(); // Optionally clear suggestions
|
suggestions.clear();
|
||||||
|
showArrow = true; // Optionally clear suggestions
|
||||||
/// Clear the filtered posts
|
/// Clear the filtered posts
|
||||||
});
|
});
|
||||||
fetchPostsByLocation();
|
fetchPostsByLocation();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onChanged: (value) {
|
onChanged: (value) async {
|
||||||
setState(() {
|
if (value.isNotEmpty) {
|
||||||
geographicalZone = value;
|
setState(() {
|
||||||
searchSuggestions(value);
|
geographicalZone = value;
|
||||||
});
|
searchSuggestions(value);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
prefs.remove("city_lat");
|
||||||
|
prefs.remove("city_long");
|
||||||
|
setState(() {
|
||||||
|
inputGeo.clear(); // Clear the text field
|
||||||
|
geographicalZone = ''; // Reset the geographical zone state
|
||||||
|
suggestions.clear(); // Optionally clear suggestions
|
||||||
|
showArrow = true;
|
||||||
|
|
||||||
|
/// Clear the filted posts
|
||||||
|
});
|
||||||
|
fetchPostsByLocation();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (suggestions.isNotEmpty)
|
if (suggestions.isNotEmpty)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user