getAnnotation function

DartObject? getAnnotation(
  1. Element element,
  2. Type annotationType
)

Implementation

DartObject? getAnnotation(Element element, Type annotationType) {
  return TypeChecker.fromRuntime(annotationType)
      .firstAnnotationOf(element, throwOnUnresolved: false);
}