registerControl method

void registerControl(
  1. FormControl<ModelDataType> control, {
  2. ChangeFunction<ViewDataType>? onChange,
})

Registers a the control with the value accessor.

The control argument must not be null.

The argument onChange is optionally and will be called every time the control emits the value change event.

Implementation

void registerControl(FormControl<ModelDataType> control,
    {ChangeFunction<ViewDataType>? onChange}) {
  _control = control;
  _onChangeSubscription = _control!.valueChanges.listen(_updateView);

  _onChange = onChange;
}