Compare commits

..

No commits in common. "d012ac409ba7dc1df94926e0ca095fc54f255dc1" and "7f4f59b6c995ffcbb2bf69d878d595c5a8e806bd" have entirely different histories.

View File

@ -420,34 +420,18 @@ 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(); suggestions.clear(); // Optionally clear suggestions
showArrow = true; // Optionally clear suggestions
/// Clear the filtered posts /// Clear the filtered posts
}); });
fetchPostsByLocation(); fetchPostsByLocation();
}, },
), ),
), ),
onChanged: (value) async { onChanged: (value) {
if (value.isNotEmpty) {
setState(() { setState(() {
geographicalZone = value; geographicalZone = value;
searchSuggestions(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)