hasFocus property

bool hasFocus

Whether the editable is currently focused.

Implementation

bool get hasFocus => _hasFocus;
void hasFocus= (bool value)

Implementation

set hasFocus(bool value) {
  assert(value != null);
  if (_hasFocus == value)
    return;
  _hasFocus = value;
  if (_hasFocus) {
    assert(!_listenerAttached);
    RawKeyboard.instance.addListener(_handleKeyEvent);
    _listenerAttached = true;
  } else {
    assert(_listenerAttached);
    RawKeyboard.instance.removeListener(_handleKeyEvent);
    _listenerAttached = false;
  }
  markNeedsSemanticsUpdate();
}