setFocus method

void setFocus({
  1. FocusNode? focusNode,
})

Requests the primary focus for this node, or for a supplied node, which will also give focus to its ancestors.

Implementation

void setFocus({FocusNode? focusNode}) {
  FocusScope.of(this).requestFocus(focusNode ?? FocusNode());
}