You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to use a SearchBarController in SearchBar(), then call _searchBarController.clear(); on selected item.
Ex:
final SearchBarController<City> _searchBarControllerCities = SearchBarController();
then on SearchBar...
SearchBar<City>(
searchBarController: _searchBarControllerCities,
..........
onItemFound: (City city, int index) {
return FlatButton(
child: Text(city.searchCity),
onPressed: () {
searchBarControllerCities.clear();
// And anything else you need to do
},
);
},
),
How can we clear and remove focus from the search bar once an item is clicked?
The text was updated successfully, but these errors were encountered: