Hi,
I am in a source_gen context and need to safely identify an annotation on a type. I tried comparing the type information I have from the analyzer with the various informations I get from reflection, but it didn't work. Probably because the information I have from reflection is in the execution context of the generator (i.e. it's obtained by running reflectType on the annotation class).
The code looks something like this:
//getter is a PropertyAccessorElement
getter.returnType.element?.metadata.any((element) =>
//element is an ElementAnnotationImpl
// how to compare it with the type of the annotation class?
);
Is this possible? built_value seems to be comparing the names of the annotation type.
Răzvan