selectItem method
void
selectItem(
- T item
Selects an item from the search results. This will store the selected item, hide the overlay, call the onSelected callback, and optionally clear the search.
Implementation
void selectItem(T item) {
_selectedItem = item;
_pendingKey = null;
// Extract and store the key if keyExtractor is provided
if (_keyExtractor != null) {
_selectedKey = _keyExtractor!(item);
_onSelected?.call(item, _selectedKey as K);
}
hideOverlay();
unfocus();
notifyListeners();
}