ReactiveFormField<ModelDataType, ViewDataType> constructor

ReactiveFormField<ModelDataType, ViewDataType>({
  1. Key? key,
  2. FormControl<ModelDataType>? formControl,
  3. String? formControlName,
  4. ControlValueAccessor<ModelDataType, ViewDataType>? valueAccessor,
  5. ShowErrorsFunction<ModelDataType>? showErrors,
  6. Map<String, ValidationMessageFunction>? validationMessages,
  7. FocusNode? focusNode,
  8. required ReactiveFormFieldBuilder<ModelDataType, ViewDataType> builder,
})

Creates an instance of the ReactiveFormField.

Must provide a forControlName or a formControl but not both at the same time.

The builder arguments are required.

Implementation

ReactiveFormField({
  super.key,
  this.formControl,
  this.formControlName,
  this.valueAccessor,
  this.showErrors,
  this.validationMessages,
  this.focusNode,
  required ReactiveFormFieldBuilder<ModelDataType, ViewDataType> builder,
}) : assert(
       (formControlName != null && formControl == null) ||
           (formControlName == null && formControl != null),
       'Must provide a formControlName or a formControl, but not both at the same time.',
     ),
     _builder = builder;