ReactiveFormField<ModelDataType, ViewDataType> constructor
ReactiveFormField<ModelDataType, ViewDataType> ({
- Key? key,
- FormControl<
ModelDataType> ? formControl, - String? formControlName,
- ControlValueAccessor<
ModelDataType, ViewDataType> ? valueAccessor, - ShowErrorsFunction? showErrors,
- ValidationMessagesFunction<
ModelDataType> ? validationMessages, - 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({
Key? key,
this.formControl,
this.formControlName,
this.valueAccessor,
this.showErrors,
this.validationMessages,
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,
super(key: key);