In its simplest form, wrapping the Focus widget around a widget subtree allows
that widget subtree to obtain focus as part of the focus traversal process, or
whenever requestFocus is called on the FocusNode passed to it. When combined
with a gesture detector that calls requestFocus, it can receive focus when
tapped or clicked.

The Focus widget is used in most of Flutter’s own controls to implement their
focus functionality.

Here is an example showing how to use the Focus widget to make a custom
control focusable. It creates a container with text that reacts to receiving the
focus.

Key events

If you wish to listen for key events in a subtree, set the onKey attribute of
the Focus widget to be a handler that either just listens to the key, or
handles the key and stops its propagation to other widgets.