annotationsOf method Null safety

Iterable<DartObject> annotationsOf(
  1. Element element,
  2. {bool throwOnUnresolved = true}
)

Returns annotating constants on element assignable to this type.

Throws UnresolvedAnnotationException on unresolved annotations unless throwOnUnresolved is explicitly set to false (default is true).

Implementation

Iterable<DartObject> annotationsOf(
  Element element, {
  bool throwOnUnresolved = true,
}) =>
    _annotationsWhere(
      element,
      isAssignableFromType,
      throwOnUnresolved: throwOnUnresolved,
    );