errorText property

String? get errorText

Implementation

String? get errorText {
  if (error != null) return error;
  if (_cd?.control?.errors != null) {
    Map<String, dynamic> errorMap = _cd!.control!.errors!;
    var stringValue = errorMap.values.firstWhere(
        ((v) => (v is String) && v.isNotEmpty),
        orElse: () => null);
    if (stringValue != null) return stringValue as String;
  }
  return null;
}