removeSearchFocus method

void removeSearchFocus()

Removes focus from the search box and resets focus state.

Implementation

void removeSearchFocus() {
  FocusScope.of(context).unfocus();
  _searchBoxKey.currentState?.removeFocus();
  setState(() {
    _searchHasFocus = false;
  });
}