FocusScope constructor Null safety

const FocusScope(
  1. {Key? key,
  2. FocusScopeNode? node,
  3. required Widget child,
  4. bool autofocus = false,
  5. ValueChanged<bool>? onFocusChange,
  6. bool? canRequestFocus,
  7. bool? skipTraversal,
  8. FocusOnKeyEventCallback? onKeyEvent,
  9. FocusOnKeyCallback? onKey,
  10. 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,
  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,
      );