query property

String get query

AppBar 中显示的当前查询字符串.

用户通过键盘操作此字符串。

如果用户点击 buildSuggestions 提供的建议,则应通过 setter 将此字符串更新为该建议。

Implementation

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

更改当前查询字符串。

以编程方式设置查询字符串会将光标移动到文本字段的末尾。

Implementation

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