FocusController constructor

FocusController({
  1. FocusNode? focusNode,
})

Constructs an instance of the focus controller.

If not focusNode is provided, then a FocusNode is created by default.

If the focusNode is provided then the focus controller will not dispose it and focusNode must be explicitly dispose after dispose focus controller instance.

Implementation

FocusController({FocusNode? focusNode})
    : _focusNode = focusNode ?? FocusNode(),
      _shouldDisposeFocusNode = focusNode == null {
  this.focusNode.addListener(_onFocusNodeFocusChanges);
}