hide clear button #26

Merged
v4l3n71n merged 1 commits from feature/hide-clear-button into main 2024-11-30 18:29:26 +00:00
Showing only changes of commit a4b747a273 - Show all commits

View File

@ -419,7 +419,9 @@ class _MyHomePageState extends State<ListItemMenu> {
readOnly: true,
decoration: InputDecoration(
border: OutlineInputBorder(),
suffixIcon: IconButton(
suffixIcon: datePicker.text.isEmpty
? null
: IconButton(
icon: const Icon(Icons.clear),
onPressed: () async {
setState(() {
@ -444,7 +446,9 @@ class _MyHomePageState extends State<ListItemMenu> {
decoration: InputDecoration(
labelText: 'Search by geographical zone',
border: OutlineInputBorder(),
suffixIcon: IconButton(
suffixIcon: inputGeo.text.isEmpty
? null
: IconButton(
icon: const Icon(Icons.clear),
onPressed: () async {
SharedPreferences prefs =
@ -453,10 +457,12 @@ class _MyHomePageState extends State<ListItemMenu> {
prefs.remove("city_long");
setState(() {
inputGeo.clear(); // Clear the text field
geographicalZone = ''; // Reset the geographical zone state
geographicalZone =
''; // Reset the geographical zone state
suggestions.clear();
showArrow = true;
showInputSearch = true; // Optionally clear suggestions
showInputSearch =
true; // Optionally clear suggestions
/// Clear the filtered posts
});
fetchPostsByLocation();
@ -537,7 +543,9 @@ class _MyHomePageState extends State<ListItemMenu> {
decoration: InputDecoration(
labelText: 'Search by item',
border: OutlineInputBorder(),
suffixIcon: IconButton(
suffixIcon: inputItem.text.isEmpty
? null
: IconButton(
icon: const Icon(Icons.clear),
onPressed: () {
setState(() {