getAnnotations method

  1. @override
List<AnnotationDeclaration> getAnnotations()
override

Returns all annotations applied to this declaration.

You can inspect custom or built-in annotations and their arguments:

Example

for (final annotation in declaration.getAnnotations()) {
  print(annotation.getTypeDeclaration().getName());
  print(annotation.getArguments());
}

Implementation

@override
List<AnnotationDeclaration> getAnnotations() => _annotations;