4inka / flutter_easy_search_bar

Other
13 stars 22 forks source link

Close search bar programmatically #5

Closed giovanni256 closed 2 years ago

giovanni256 commented 2 years ago

Hi there.

Since I tapped on a suggestion, is there a way to close the search bar programmatically?

I tried to use Navigator.of(context).pop(false)

And also... Navigator.pop(context)

But I always get a crash. Thanks in advance.

giovanni256 commented 2 years ago

Solved using the source code and implementing it in my app.

rubencalje commented 1 year ago

I know this issue is closed, but can you explain in more detail how you did it?

I also want to close the search bar programmatically as soon as a user taps one of the suggestions. It seems I have to call closeOverlay in onSearch, but I did not find a way to do it (as I do not have a reference to the EasySearchBar-instance in onSearch).

Maybe an option could be added that closes the search-overlay as soon as the user taps one of the suggestions? I think this would be helpful to a lot of people.

Thank you.

giovanni256 commented 1 year ago

I know this issue is closed, but can you explain in more detail how you did it?

I also want to close the search bar programmatically as soon as a user taps one of the suggestions. It seems I have to call closeOverlay in onSearch, but I did not find a way to do it (as I do not have a reference to the EasySearchBar-instance in onSearch).

Maybe an option could be added that closes the search-overlay as soon as the user taps one of the suggestions? I think this would be helpful to a lot of people.

Thank you.

Hi there, I had to copy the repo and implement it in my app by myself. Then I changed the code with Navigator.of(context).pop(true) when the user taps on the suggestion.

I don't know why they don't implement this function...