firstAnnotationOfExact method

ElementAnnotation? firstAnnotationOfExact(
  1. Element element
)

Examines the annotations on element related to this type checker.

Returns the first constant annotating element that is exactly this type.

Implementation

ElementAnnotation? firstAnnotationOfExact(Element element) {
  if (element.metadata.isEmpty) {
    return null;
  }
  final Iterable<ElementAnnotation> results = annotationsOfExact(element);
  return results.isEmpty ? null : results.first;
}