Focus constructor Null safety

const Focus(
  1. {Key? key,
  2. required Widget child,
  3. FocusNode? focusNode,
  4. bool autofocus,
  5. ValueChanged<bool>? onFocusChange,
  6. FocusOnKeyCallback? onKey,
  7. FocusOnKeyEventCallback? onKeyEvent,
  8. String? debugLabel,
  9. bool? canRequestFocus,
  10. bool descendantsAreFocusable,
  11. bool? skipTraversal,
  12. bool includeSemantics}
)

Creates a widget that manages a FocusNode.

The child argument is required and must not be null.

The autofocus argument must not be null.

Implementation

const Focus({
  Key? key,
  required this.child,
  this.focusNode,
  this.autofocus = false,
  this.onFocusChange,
  this.onKey,
  this.onKeyEvent,
  this.debugLabel,
  this.canRequestFocus,
  this.descendantsAreFocusable = true,
  this.skipTraversal,
  this.includeSemantics = true,
})  : assert(child != null),
      assert(autofocus != null),
      assert(descendantsAreFocusable != null),
      assert(includeSemantics != null),
      super(key: key);