findType method

ClassElement? findType(
  1. String name
)

Returns a top-level ClassElement publicly visible in by name.

Unlike LibraryElement.getClass, this also correctly traverses identifiers that are accessible via one or more export directives.

Implementation

ClassElement? findType(String name) {
  final type = element.exportNamespace.get(name);
  return type is ClassElement ? type : null;
}