firstComponentAnnotation static method

IndexedAnnotation<Element> firstComponentAnnotation(
  1. ClassElement element
)

Implementation

static IndexedAnnotation firstComponentAnnotation(ClassElement element) {
  final index = element.metadata.indexWhere(isComponent);
  if (index == -1) {
    throw ArgumentError('[element] must have a @Component annotation');
  }
  return IndexedAnnotation(element, element.metadata[index], index);
}