visitImportDeclaration method

  1. @override
Future<Element> visitImportDeclaration(
  1. ImportDeclaration node
)
override

Implementation

@override
Future<Element> visitImportDeclaration(ImportDeclaration node) async {
  final package = switch (node.type) {
    ImportType.dart => DartSdkPackage(name: node.identifier.lexeme.substring(1)),
    ImportType.package => ExternalPackage(name: node.identifier.lexeme),
  };

  return ImportElement(package: package);
}