You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the ReactiveFormFieldState class has a method that returns only the first error message encountered. Below is the existing implementation:
String?get errorText {
if (control.hasErrors && _showErrors) {
final errorKey = control.errors.keys.first;
final validationMessage =_findValidationMessage(errorKey);
return validationMessage !=null?validationMessage(control.getError(errorKey)!)
: errorKey;
}
returnnull;
}
Request
I would like to request an additional getter that returns a list containing all error messages. This enhancement would allow for better error handling and display in forms.
Proposed Implementation
List<String> get errorMessages {
if (control.hasErrors && _showErrors) {
return control.errors.keys.map((errorKey) {
final validationMessage =_findValidationMessage(errorKey);
return validationMessage !=null?validationMessage(control.getError(errorKey)!)
: errorKey;
}).toList();
}
return [];
}
Benefits
Improved error handling: Users can see all validation errors at once.
Enhanced user experience: More informative error messages help users understand and correct form input errors more efficiently.
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered:
Environment
Description
Currently, the
ReactiveFormFieldState
class has a method that returns only the first error message encountered. Below is the existing implementation:Request
I would like to request an additional getter that returns a list containing all error messages. This enhancement would allow for better error handling and display in forms.
Proposed Implementation
Benefits
Thank you for considering this feature request.
The text was updated successfully, but these errors were encountered: