onQueryChanged method

void onQueryChanged(
  1. String query
)

Called when the search bar query has changed.

Implementation

void onQueryChanged(String query) async {
  query = query.trim();
  pagingController = null;

  if (query.isEmpty) {
    _searchSuggestions = [];
    _isSearching = false;
    setState(() {});
    return;
  }

  mediaSource.generateSearchSuggestions(query).then((newSuggestions) {
    _searchSuggestions = newSuggestions;
    setState(() {});
  });
}