FocusScope constructor Null safety

const FocusScope(
  1. {Key? key,
  2. FocusScopeNode? node,
  3. FocusNode? parentNode,
  4. required Widget child,
  5. bool autofocus = false,
  6. ValueChanged<bool>? onFocusChange,
  7. bool? canRequestFocus,
  8. bool? skipTraversal,
  9. FocusOnKeyEventCallback? onKeyEvent,
  10. FocusOnKeyCallback? onKey,
  11. String? debugLabel}
)

Creates a widget that manages a FocusScopeNode.

The child argument is required and must not be null.

The autofocus argument must not be null.

Implementation

const FocusScope({
  super.key,
  FocusScopeNode? node,
  super.parentNode,
  required super.child,
  super.autofocus,
  super.onFocusChange,
  super.canRequestFocus,
  super.skipTraversal,
  super.onKeyEvent,
  super.onKey,
  super.debugLabel,
})  : assert(child != null),
      assert(autofocus != null),
      super(
        focusNode: node,
      );