findAnnotationByName function
Implementation
ElementAnnotation? findAnnotationByName(Element element, String type) {
ElementAnnotation? annotation;
for (final element in element.metadata) {
if ((element.element?.displayName == type ||
element.element?.name == type)) {
annotation = element;
break;
}
}
return annotation;
}