control<T> method

FormControl<T> control<T>(
  1. T value, [
  2. List<ValidatorFunction> validators = const [],
  3. List<AsyncValidatorFunction> asyncValidators = const []
])

Construct a new FormControl instance.

Can optionally provide a validators collection for the control.

Can optionally provide a asyncValidators collection for the control.

Example:

Creates a control with default value.

final name = fb.control('John Doe');
```

Creates a control with required validator.
````dart
final control = fb.control('', [Validators.required]);
```

Implementation

FormControl<T> control<T>(
  T value, [
  List<ValidatorFunction> validators = const [],
  List<AsyncValidatorFunction> asyncValidators = const [],
]) {
  return FormControl<T>(
    value: value,
    validators: validators,
    asyncValidators: asyncValidators,
  );
}