toggleSearch method

void toggleSearch([
  1. bool? value
])

Enables or disabled searching of the ChatItems of this Chat.

Implementation

void toggleSearch([bool? value]) {
  if (value ?? searching.value) {
    searching.value = false;
    search.clear();
    query.value = null;
    search.focus.removeListener(_disableSearchFocusListener);
    switchToMessages();
  } else {
    searching.value = true;
    search.focus.requestFocus();
    search.focus.addListener(_disableSearchFocusListener);
  }
}