firstAnnotation method

ElementAnnotation? firstAnnotation(
  1. TypeIdentifier type
)

Implementation

ElementAnnotation? firstAnnotation(TypeIdentifier type) {
  for (final annotation in metadata2.annotations) {
    if (annotation.annotationType case final Element2 element) {
      if (element.name3 != type.name) continue;
      if (element.library2?.uri != type.lib) continue;
      return annotation;
    }
  }
  return null;
}