errorText property Null safety

String? errorText

Gets the error text calculated from validators of the control.

If the control has several errors, then the first error is selected for visualizing in UI.

Implementation

String? get errorText {
  if (_showErrors()) {
    final validationMessages = _getValidationMessages(control);
    return validationMessages.containsKey(control.errors.keys.first)
        ? validationMessages[control.errors.keys.first]
        : control.errors.keys.first;
  }

  return null;
}