smartnsoft / flappy_search_bar

SearchBar widget to handle most of search cases
MIT License
173 stars 93 forks source link

Feature Request: Expose Cancel Button onTap Listener #2

Closed gscottschulz closed 4 years ago

gscottschulz commented 4 years ago

I was wondering if you'd be able to expose a way for people to react to a tap event on the Cancel button that animates in after performing a search? I have a screen on which this would be REALLY useful. Awesome plugin by the way!!

Thanks Scott

ThomasEcalle commented 4 years ago

Hi Scott,

Thanks a lot :) Yes that could be a feature.

To be sure that I understand your needs, you would like to be able to have a callback called whenever the cancel button (and the animation) is triggered ? So everything would work as now, but you will be called when button is clicked.

Is this what you would need ?

gscottschulz commented 4 years ago

@ThomasEcalle Yeah, when someone taps the cancel button I need to have a function invoked. Being able to pass in a function on the SearchBar constructor would be great. I don't think the function would need to return anything or need any parameters, but I'll leave that up to you to decide. Thanks!!

ThomasEcalle commented 4 years ago

Ok @gscottschulz, no problem, I'll implement it tomorrow and will let you know when it would be ready, nice idea ! :)

ThomasEcalle commented 4 years ago

Hi @gscottschulz,

The new 1.5.2 version is available with a onCancelled callback that you can implement in order to get what you need :)

I hope it will help you !

gscottschulz commented 4 years ago

@ThomasEcalle Thanks!!!