Focus constructor

const Focus({
  1. Key? key,
  2. required Widget child,
  3. FocusNode? focusNode,
  4. FocusNode? parentNode,
  5. bool autofocus = false,
  6. ValueChanged<bool>? onFocusChange,
  7. FocusOnKeyEventCallback? onKeyEvent,
  8. @Deprecated('Use onKeyEvent instead. ' 'This feature was deprecated after v3.18.0-2.0.pre.') FocusOnKeyCallback? onKey,
  9. bool? canRequestFocus,
  10. bool? skipTraversal,
  11. bool? descendantsAreFocusable,
  12. bool? descendantsAreTraversable,
  13. bool includeSemantics = true,
  14. String? debugLabel,
})

Creates a widget that manages a FocusNode.

Implementation

const Focus({
  super.key,
  required this.child,
  this.focusNode,
  this.parentNode,
  this.autofocus = false,
  this.onFocusChange,
  FocusOnKeyEventCallback? onKeyEvent,
  @Deprecated(
    'Use onKeyEvent instead. '
    'This feature was deprecated after v3.18.0-2.0.pre.',
  )
  FocusOnKeyCallback? onKey,
  bool? canRequestFocus,
  bool? skipTraversal,
  bool? descendantsAreFocusable,
  bool? descendantsAreTraversable,
  this.includeSemantics = true,
  String? debugLabel,
})  : _onKeyEvent = onKeyEvent,
      _onKey = onKey,
      _canRequestFocus = canRequestFocus,
      _skipTraversal = skipTraversal,
      _descendantsAreFocusable = descendantsAreFocusable,
      _descendantsAreTraversable = descendantsAreTraversable,
      _debugLabel = debugLabel;