FormField<T> constructor Null safety

const FormField<T>(
  1. {Key? key,
  2. required FormFieldBuilder<T> builder,
  3. FormFieldSetter<T>? onSaved,
  4. FormFieldValidator<T>? validator,
  5. T? initialValue,
  6. @Deprecated('Use autovalidateMode parameter which provides more specific ' 'behavior related to auto validation. ' 'This feature was deprecated after v1.19.0.') bool autovalidate,
  7. bool enabled,
  8. AutovalidateMode? autovalidateMode,
  9. String? restorationId}
)

Creates a single form field.

The builder argument must not be null.

Implementation

const FormField({
  Key? key,
  required this.builder,
  this.onSaved,
  this.validator,
  this.initialValue,
  @Deprecated(
    'Use autovalidateMode parameter which provides more specific '
    'behavior related to auto validation. '
    'This feature was deprecated after v1.19.0.',
  )
  this.autovalidate = false,
  this.enabled = true,
  AutovalidateMode? autovalidateMode,
  this.restorationId,
}) : assert(builder != null),
     assert(
       autovalidate == false ||
       autovalidate == true && autovalidateMode == null,
       'autovalidate and autovalidateMode should not be used together.',
     ),
     autovalidateMode = autovalidateMode ??
       (autovalidate ? AutovalidateMode.always : AutovalidateMode.disabled),
     super(key: key);