declaredAnnotationOf method

Object? declaredAnnotationOf(
  1. String name
)

The annotation the nearest declaration of name was written with, or null when that declaration has none or name is not declared.

Implementation

Object? declaredAnnotationOf(String name) {
  for (Environment? env = this; env != null; env = env._enclosing) {
    if (env._values.containsKey(name) ||
        (env._slotIndex?.containsKey(name) ?? false)) {
      return env._declaredAnnotations?[name];
    }
  }
  return null;
}