Compare commits

..

No commits in common. "3315cf196122bf3da054aba934fde30889f0d573" and "6b53dc170d620d3e9f5ae517d20d128e01698890" have entirely different histories.

View File

@ -419,17 +419,15 @@ class _MyHomePageState extends State<ListItemMenu> {
readOnly: true, readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder(), border: OutlineInputBorder(),
suffixIcon: datePicker.text.isEmpty suffixIcon: IconButton(
? null icon: const Icon(Icons.clear),
: IconButton( onPressed: () async {
icon: const Icon(Icons.clear), setState(() {
onPressed: () async { datePicker.text = '';
setState(() { });
datePicker.text = ''; fetchPostsByLocation();
}); },
fetchPostsByLocation(); ),
},
),
hintText: hintText), hintText: hintText),
onTap: () => onTap: () =>
onTapFunctionDatePicker(context: context, position: position)), onTapFunctionDatePicker(context: context, position: position)),
@ -446,28 +444,24 @@ class _MyHomePageState extends State<ListItemMenu> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Search by geographical zone', labelText: 'Search by geographical zone',
border: OutlineInputBorder(), border: OutlineInputBorder(),
suffixIcon: inputGeo.text.isEmpty suffixIcon: IconButton(
? null icon: const Icon(Icons.clear),
: IconButton( onPressed: () async {
icon: const Icon(Icons.clear), SharedPreferences prefs =
onPressed: () async { await SharedPreferences.getInstance();
SharedPreferences prefs = prefs.remove("city_lat");
await SharedPreferences.getInstance(); prefs.remove("city_long");
prefs.remove("city_lat"); setState(() {
prefs.remove("city_long"); inputGeo.clear(); // Clear the text field
setState(() { geographicalZone = ''; // Reset the geographical zone state
inputGeo.clear(); // Clear the text field suggestions.clear();
geographicalZone = showArrow = true;
''; // Reset the geographical zone state showInputSearch = true; // Optionally clear suggestions
suggestions.clear(); /// Clear the filtered posts
showArrow = true; });
showInputSearch = fetchPostsByLocation();
true; // Optionally clear suggestions },
/// Clear the filtered posts ),
});
fetchPostsByLocation();
},
),
), ),
onChanged: (value) async { onChanged: (value) async {
if (value.isNotEmpty) { if (value.isNotEmpty) {
@ -543,21 +537,19 @@ class _MyHomePageState extends State<ListItemMenu> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Search by item', labelText: 'Search by item',
border: OutlineInputBorder(), border: OutlineInputBorder(),
suffixIcon: inputItem.text.isEmpty suffixIcon: IconButton(
? null icon: const Icon(Icons.clear),
: IconButton( onPressed: () {
icon: const Icon(Icons.clear), setState(() {
onPressed: () { inputItem.clear();
setState(() { itemName = ''; // Reset the geographical zone state
inputItem.clear(); suggestionsItem.clear();
itemName = ''; // Reset the geographical zone state showDateFields = true;
suggestionsItem.clear(); showArrow = true;
showDateFields = true; });
showArrow = true; fetchPostsByLocation();
}); },
fetchPostsByLocation(); ),
},
),
), ),
onChanged: (value) { onChanged: (value) {
if (value.isNotEmpty) { if (value.isNotEmpty) {