ArcticZeroo / flutter-search-bar

(mostly) Automatic search-enabled appBar for flutter
BSD 3-Clause "New" or "Revised" License
266 stars 69 forks source link

Add the searchEnabled flag to getSearchAction #27

Closed dineshba closed 5 years ago

dineshba commented 5 years ago

This is to fix the issue https://github.com/ArcticZeroo/flutter-search-bar/issues/25.

Please have a look and provide the feedbacks. Thanks.

dineshba commented 5 years ago

I have added an example to test it. Please refer https://github.com/dineshba/flutter-search-bar/commit/c1fee7a0aa646b4887207e74d9b6af2eee9a605b

dineshba commented 5 years ago

@ArcticZeroo When you are available please have a look at it

ArcticZeroo commented 5 years ago

I think we may want to implement it a different way. Here's my thoughts on the implementation:

When the developer changes the value of the value notifier, the opacity can be updated pretty easily (though it may require wrapping the component). It seems heavy-handed to me to require the developer to know if the search is enabled when requesting the search action.

Realistically though this may be a failure of how I wrote the search bar in the first place, and I intend to eventually replace it with a single stateful widget.

Thoughts?