doGetDirectory method

  1. @override
String doGetDirectory(
  1. PackageId id,
  2. SystemCache cache, {
  3. String? relativeFrom,
})

Returns the directory where this package can (or could) be found locally.

If the source is cached, this will be a path in the system cache.

If id is a relative path id, the directory will be relative from relativeFrom. Returns an absolute path if relativeFrom is not passed.

Implementation

@override
String doGetDirectory(
  PackageId id,
  SystemCache cache, {
  String? relativeFrom,
}) {
  final dir = getDirectoryInCache(id, cache);
  if (p.isRelative(dir)) {
    return p.relative(dir, from: relativeFrom);
  }
  return dir;
}