textFieldController method
Retrieves the TextEditingController for a given text field and ensures it is observed.
If a listener hasn't been registered for the given fieldName, this method
will add one that automatically updates the form state when the controller's text changes.
- Parameter
fieldName: The name of the text field to observe. - Returns: The TextEditingController associated with the given
fieldName.
Implementation
widgets.TextEditingController textFieldController(String fieldName) {
final field = state.textField(fieldName);
_observeTextField(fieldName, field.controller);
return field.controller;
}