Form constructor Null safety

const Form(
  1. {Key? key,
  2. required Widget child,
  3. WillPopCallback? onWillPop,
  4. VoidCallback? onChanged,
  5. AutovalidateMode? autovalidateMode}
)

Creates a container for form fields.

The child argument must not be null.

Implementation

const Form({
  super.key,
  required this.child,
  this.onWillPop,
  this.onChanged,
  AutovalidateMode? autovalidateMode,
}) : assert(child != null),
     autovalidateMode = autovalidateMode ?? AutovalidateMode.disabled;