getClassAnnotation function

ConstantReader? getClassAnnotation(
  1. ClassElement clazz,
  2. Type type
)

Implementation

ConstantReader? getClassAnnotation(ClassElement clazz, Type type) {
  final annot =
      typeChecker(type).firstAnnotationOf(clazz, throwOnUnresolved: false);
  if (annot != null) return ConstantReader(annot);
  return null;
}