getErrorMessages method

List<String>? getErrorMessages(
  1. String attribute
)

Get the error messages associated with a form attribute.

The getErrorMessages function is used to retrieve the error messages associated with a specific form attribute. It looks up the attribute in the _errors map and returns the list of error messages. If no custom error messages are associated with the attribute, the function returns null.

Parameters:

  • attribute: The identifier of the form attribute for which you want to retrieve error messages.

Returns: A list of error messages associated with the specified form attribute, or null if no error messages are found.

Implementation

List<String>? getErrorMessages(String attribute) {
  return _errors[attribute];
}