DartAstParser class

Lightweight AST parser that uses parseString for fast, non-resolved parsing of Dart source files. This works without needing a full analysis context, making it fast and portable.

Constructors

DartAstParser()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

extractClasses(CompilationUnit unit) → List<ClassDeclaration>
Extracts all class declarations from a compilation unit.
extractConstructorParams(ClassDeclaration classDecl) → List<String>
Extracts constructor parameter names from a class.
extractFunctions(CompilationUnit unit) → List<FunctionDeclaration>
Extracts all top-level function declarations from a compilation unit.
extractPublicMethods(ClassDeclaration classDecl) → List<String>
Extracts public method names from a class declaration.
hasConstConstructor(ClassDeclaration classDecl) → bool
Checks if a class has a const constructor.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseSource(String source) → CompilationUnit
Parses a Dart source string and returns the compilation unit.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited