I'm building a dart obfuscation tool
I need to suppress obfuscation when an identifier is exported.
If an class is exported then all of its methods and fields are also considered exported and as such must not be obfuscated.
```dart
export 'somelibrary.dart';
```
```dart
// somelibrary.dart
class Test {
String header;
void amethod() {
header = 'a';
}
}
```
So my problem is with the line `header = 'a'`.
I'm using the GeneralizingAstVisitor which yields:
```
* ClassDeclarationImpl (class Sample {Sample({required
this.name}) {header = 'hi';} void amethod() {} void method({String? arg}) {} String name; late final String header;})
* ConstructorDeclarationImpl (Sample({required
this.name}) {header = 'hi';})
* BlockImpl ({header = 'hi';})
* ExpressionStatementImpl (header = 'hi';)
* AssignmentExpressionImpl (header = 'hi')
* SimpleIdentifierImpl (header)
```
The issue is that I can't find a way to determine if the SimpleIdentifier 'header' is a field of Test.
I can see that the SimpleIdentifierImpl.scopeLookupResult has the required information but SimpleIdentifierImpl isn't a public class so I can't access it in code.
I could navigate up the tree which would yield a ClassDeclaration but this would still leave me with the question as to whether 'header' is a field, local or parameter.
An help would be appreciated.