search method

void search(
  1. String query
)

Searches messages whose text matches query, debounced by its length.

query is matched against the message text as an autocomplete filter. A blank query clears the results instead of querying, since the backend rejects empty message searches. Rapidly superseded searches are dropped, so only the latest query's results are applied.

To search on other message fields, use searchWithFilter.

Implementation

void search(String query) {
  final trimmed = query.trim();
  if (trimmed.isEmpty) return clearResults();

  final searchFilter = Filter.autoComplete('text', trimmed);

  return searchWithFilter(searchFilter);
}