control<T, V> method

FormControl<T, V> control<T, V>(
  1. String name
)

Returns a FormControl with the given name.

Throws if the control does not exist or if it is a nested group.

Implementation

FormControl<T, V> control<T, V>(String name) {
  final ctrl = controls[name];
  if (ctrl == null) throw Exception('FormControl "$name" não encontrado');
  if (ctrl is FormGroup) {
    throw Exception(
        'O controle "$name" é um FormGroup, use group() para acessá-lo.');
  }
  return ctrl as FormControl<T, V>;
}