textField method
Retrieves the TextFieldState for a given text field.
This method simplifies fetching the state of a text field with a specified fieldName
.
- Parameter
fieldName
: The name of the text field for which the state is to be fetched. - Returns: The TextFieldState corresponding to the given
fieldName
. - Throws: ArgumentError if the field doesn't exist.
Implementation
TextFieldState textField(String fieldName) {
return get<TextFieldState, String?>(fieldName);
}