updateQuery method

void updateQuery(
  1. String rawQuery
)

Update search results for rawQuery.

Normalises the query, runs the search function, and resets the selection to the first result. The caller should rebuild its UI after calling this.

Implementation

void updateQuery(String rawQuery) {
  if (rawQuery.isEmpty) {
    _results = [];
    _selectedIndex = 0;
    return;
  }
  final normalized = _normalizeFn(rawQuery);
  _results = _searchFn(normalized);
  _selectedIndex = 0;
}