requestFocus method

void requestFocus (FocusNode node)

Requests that the given node becomes the focus for this scope.

If the given node is currently focused in another scope, the node will first be unfocused in that scope.

The node will receive the overall focus if this isFirstFocus is true in this scope and all its ancestor scopes. The node is notified that it has received the overall focus in a microtask.

Implementation

void requestFocus(FocusNode node) {
  assert(node != null);
  if (_focus == node)
    return;
  _focus?.unfocus();
  node._hasKeyboardToken = true;
  _setFocus(node);
}