visitImportStatement method

  1. @override
void visitImportStatement(
  1. ImportStatement statement
)
override

Implementation

@override
void visitImportStatement(ImportStatement statement) {
  assert(_currentContext == null);
  assert(_currentClass == null);

  final url = switch (statement.type) {
    ImportType.dart => 'dart:${statement.identifier.lexeme.substring(1)}',
    ImportType.package => 'package:${statement.identifier.lexeme}.dart',
  };

  _directives.add(
    Directive.import(url),
  );
}