hasAnnotationOf method

bool hasAnnotationOf(
  1. Element element, {
  2. bool throwOnUnresolved = true,
})

Returns if a constant annotating element is assignable to this type.

Throws on unresolved annotations unless throwOnUnresolved is false.

Implementation

bool hasAnnotationOf(Element element, {bool throwOnUnresolved = true}) =>
    firstAnnotationOf(element, throwOnUnresolved: throwOnUnresolved) != null;