query property Null safety

String query

The current query string shown in the AppBar.

The user manipulates this string via the keyboard.

If the user taps on a suggestion provided by buildSuggestions this string should be updated to that suggestion via the setter.

Implementation

String get query => _queryTextController.text;
void query=(String value)

Changes the current query string.

Setting the query string programmatically moves the cursor to the end of the text field.

Implementation

set query(String value) {
  assert(query != null);
  _queryTextController.text = value;
  if (_queryTextController.text.isNotEmpty) {
    _queryTextController.selection = TextSelection.fromPosition(TextPosition(offset: _queryTextController.text.length));
  }
}