getMethodAnnotation function

ConstantReader? getMethodAnnotation(
  1. MethodElement method,
  2. Type type
)

Implementation

ConstantReader? getMethodAnnotation(MethodElement method, Type type) {
  final annot =
      typeChecker(type).firstAnnotationOf(method, throwOnUnresolved: false);
  if (annot != null) return ConstantReader(annot);
  return null;
}