Open
Description
I asked at SO before coming here.
I am working on a Dart builder and need to inspect the metadata (annotations) applied to the named fields of a RecordType
. However, while I can successfully access RecordType.namedFields
, the resulting RecordTypeNamedField
objects do not appear to expose any metadata-related members.
Here is an example of the code I am trying to analyze:
Future<({@SomeAnnotation() String foo, int bar})?> someFunction() async {
return null;
}
In this case, I need to determine programmatically that the foo
field is annotated with @SomeAnnotation
.
My Setup:
Dart SDK: 3.6.0
Analyzer version: 6.11.0
Question:
How can I access the metadata (annotations) of a named field in a RecordType
using Dart's analyzer package in the context of a builder? Is there a specific API or workaround to achieve this?