TextFieldState
This represents the different states a field can be in, in each of these cases there might be a reason to show the error in a different way. This interface separates how the state is implemented from what information is required by clients of the interface. This will allow the implementation to change without impacting the clients.
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
If in a state where isValid() returns false, this function returns the error message. It is up to calling shouldShowError to determine if it should be displayed on screen.
Link copied to clipboard
Indicate if this is an error that should be displayed to the user. This cannot be used to determine if the field is valid or not because there are some cases such as incomplete or blank where the error is not displayed, but also not valid.