clearSelection method

void clearSelection({
  1. bool requestFocus = true,
})

Clears the selected item and shows the search box. Optionally requests focus on the search field.

Implementation

void clearSelection({bool requestFocus = true}) {
  _selectedItem = null;
  clearSearch();
  if (requestFocus) {
    this.requestFocus();
  }
  notifyListeners();
}