focusNode property Null safety

FocusNode focusNode
final

Defines the keyboard focus for this widget.

The focusNode is a long-lived object that's typically managed by a StatefulWidget parent. See FocusNode for more information.

Sample code

CodeInput(focusNode: myFocusNode);

You can then request the CodeInput's focus by calling:

FocusScope.of(context).requestFocus(myFocusNode);

Implementation

final FocusNode focusNode;