visitImportDirective method

  1. @override
dynamic visitImportDirective(
  1. ImportDirective node
)
override

Finds the import prefix of the library.

Implementation

@override
visitImportDirective(ImportDirective node) {
  // Only if the import isn't done yet and if it is an import of the library.
  if (_imported || node.uri.stringValue != package) return;
  _imported = true;
  if (node.prefix != null) _importPrefix = node.prefix!.name;
}