Merge pull request 'hide clear button' (#26) from feature/hide-clear-button into main
Reviewed-on: #26
This commit is contained in:
commit
3315cf1961
@ -419,7 +419,9 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
readOnly: true,
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: datePicker.text.isEmpty
|
||||||
|
? null
|
||||||
|
: IconButton(
|
||||||
icon: const Icon(Icons.clear),
|
icon: const Icon(Icons.clear),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -444,7 +446,9 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Search by geographical zone',
|
labelText: 'Search by geographical zone',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: inputGeo.text.isEmpty
|
||||||
|
? null
|
||||||
|
: IconButton(
|
||||||
icon: const Icon(Icons.clear),
|
icon: const Icon(Icons.clear),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
SharedPreferences prefs =
|
SharedPreferences prefs =
|
||||||
@ -453,10 +457,12 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
prefs.remove("city_long");
|
prefs.remove("city_long");
|
||||||
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();
|
||||||
showArrow = true;
|
showArrow = true;
|
||||||
showInputSearch = true; // Optionally clear suggestions
|
showInputSearch =
|
||||||
|
true; // Optionally clear suggestions
|
||||||
/// Clear the filtered posts
|
/// Clear the filtered posts
|
||||||
});
|
});
|
||||||
fetchPostsByLocation();
|
fetchPostsByLocation();
|
||||||
@ -537,7 +543,9 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Search by item',
|
labelText: 'Search by item',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: inputItem.text.isEmpty
|
||||||
|
? null
|
||||||
|
: IconButton(
|
||||||
icon: const Icon(Icons.clear),
|
icon: const Icon(Icons.clear),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user