Open ArcticZeroo opened 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.
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.