FocusNode constructor

FocusNode(
  1. {String debugLabel,
  2. FocusOnKeyCallback onKey,
  3. bool skipTraversal: false,
  4. bool canRequestFocus: true}
)

Creates a focus node.

The debugLabel is ignored on release builds.

The skipTraversal and canRequestFocus arguments must not be null.

Implementation

FocusNode({
  String debugLabel,
  FocusOnKeyCallback onKey,
  bool skipTraversal = false,
  bool canRequestFocus = true,
})  : assert(skipTraversal != null),
      assert(canRequestFocus != null),
      _skipTraversal = skipTraversal,
      _canRequestFocus = canRequestFocus,
      _onKey = onKey {
  // Set it via the setter so that it does nothing on release builds.
  this.debugLabel = debugLabel;
}