currentIsolate static method

Future<PackageAssetReader> currentIsolate(
  1. {String? rootPackage}
)

A reader that can resolve files known to the current isolate.

A rootPackage should be provided for full API compatibility.

Implementation

static Future<PackageAssetReader> currentIsolate(
    {String? rootPackage}) async {
  final packageConfigUri = await Isolate.packageConfig ??
      (throw UnsupportedError('No package config found'));
  final packageConfig = await loadPackageConfigUri(packageConfigUri);

  return PackageAssetReader(packageConfig, rootPackage);
}