textControl method

FormControl<TextEditingValue, String> textControl(
  1. String name
)

Returns a FormControl specialized for text input with the given name.

Throws if the control does not exist or is not a text control.

Implementation

FormControl<TextEditingValue, String> textControl(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<TextEditingValue, String>;
}