packagePath method

String packagePath (
  1. String package

Returns the path on the local filesystem to the root of package, or null if the root cannot be found.

Note: this assumes a pub-style package layout. In particular:

  • If a package root is being used, this assumes that it contains symlinks to packages' lib/ directories.

  • If a package config is being used, this assumes that each entry points to a package's lib/ directory.

If these assumptions are broken, this may return null or it may return an invalid result.

Returns null if the package root is not a file: URI, or if the package config entry for package is not a file: URI.


String packagePath(String package);