ArcticZeroo / flutter-search-bar

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

SearchBar should be a StatefulWidget #28

Open ArcticZeroo opened 5 years ago

ArcticZeroo commented 5 years ago

There's no reason that SearchBar should not be a Widget, and furthermore passing setState and forcing the entire main Scaffold to rebuild is messy.

The SearchBar should be rewritten as a StatefulWidget. If we really want to avoid breaking, we could just make it a new class (SearchBarWidget).

It should take a Builder for building the AppBar. The getSearchAction method will be the only tricky bit.

Ideally we also support theming with Theme.of instead of hardcoded values, so that developers can wrap the widget in a Theme.