importLibrary abstract method

String importLibrary(
  1. Uri uri, {
  2. String? prefix,
  3. String? showName,
  4. bool useShow = false,
})

Arranges to have an import added for the library with the given uri.

If a prefix is provided it will be used in the import directive.

If showName is provided, imports will be modified to make sure this symbol is shown.

If useShow is true, new imports will show only the given showName, instead of importing the library without a show clause.

Returns the text of the URI that will be used in the import directive. It can be different than the given uri.

The uri may be converted from an absolute URI to a relative URI depending on the set of enabled lints.

Implementation

String importLibrary(
  Uri uri, {
  String? prefix,
  String? showName,
  bool useShow = false,
});