setKeepFocus method

  1. @override
void setKeepFocus(
  1. bool flag, {
  2. bool notify = true,
})
inherited

Implementation

@override
void setKeepFocus(bool flag, {bool notify = true}) {
  if (keepFocus == flag && keepFocus == hasFocus) {
    return;
  }

  _state._keepFocus = flag;

  if (keepFocus) {
    gridFocusNode.requestFocus();
  }

  if (keepFocus) {
    // RequestFocus is fired and notifies listeners with hasFocus true.
    // requestFocus delays up to one frame.
    notifyListenersOnPostFrame(notify, setKeepFocus.hashCode);
  } else {
    notifyListeners(notify, setKeepFocus.hashCode);
  }
}