ArcticZeroo/flutter-search-bar

Add support for OnChange events to support autocomplete features

jiachen247 opened this issue · 4 comments

Add support for OnChange events to support autocomplete features

This would be great

What would be the ideal implementation here? Would you just like an onChange event so that you can supply the autocomplete yourself, or would you like to supply a list of things to autocomplete from which populates somehow below the search bar while the user types?

If you're looking for the former, I would recommend using a TextEditingController when initializing the SearchBar and listen to the value changed from there (which is, as far as I know, the recommended way in flutter), but I suppose it wouldn't be difficult to add a default onChanged handler which uses an internal TextEditingController.

If you're looking for the latter, what would be the ideal implementation of it for your use? Would this autocomplete list ever change after the SearchBar is initialized? If so, the issue becomes a decent bit more complex

I'm definitely open to adding this, just want to make sure we're all on the same page here

p.s. I usually find/respond to issues faster, somehow these notifications slipped by

It looks like there are a significant amount of forks using onChanged, so I'll add it to the main repo