Muhammad chhota
Muhammad chhota

Reputation: 1927

How to get Annotation metadata in Dart?

I am using package:analyzer package. I have extended SimpleElementVisitor to visit all the fields of the class. visitFieldElement(FieldElement element) is providing all the fields data type and fields name. But some of the fields are annotated with custom annotation. How I can read the metadata of that annotation?

Upvotes: 1

Views: 1914

Answers (1)

Nate Bosch
Nate Bosch

Reputation: 10925

From the Element instance (A FieldElement in the example) you can use the metadata field to read out annotations.

Upvotes: 1

Related Questions