How to access metadata of Named Fields in a RecordType using Dart Analyzer? #59817
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
triage-automation
See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.
type-question
A question about expected behavior or functionality
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 accessRecordType.namedFields
, the resultingRecordTypeNamedField
objects do not appear to expose any metadata-related members.Here is an example of the code I am trying to analyze:
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?The text was updated successfully, but these errors were encountered: