findAnnotation function
Implementation
ElementAnnotation? findAnnotation(Element element, Type type) {
final typeName = type.toString();
ElementAnnotation? annotation;
for (final e in element.metadata) {
if ((e.element?.displayName == typeName || e.element?.name == typeName)) {
annotation = e;
break;
}
}
return annotation;
}