resolveAsset<T> function

Future<T> resolveAsset <T>(AssetId inputId, FutureOr<T> action(Resolver resolver), { PackageResolver resolver, Future<Null> tearDown, Resolvers resolvers })

A convenience for using resolveSources with a single inputId from disk.

Implementation

Future<T> resolveAsset<T>(
  AssetId inputId,
  FutureOr<T> action(Resolver resolver), {
  PackageResolver resolver,
  Future<Null> tearDown,
  Resolvers resolvers,
}) {
  return _resolveAssets(
    {
      '${inputId.package}|${inputId.path}': useAssetReader,
    },
    inputId.package,
    action,
    resolver: resolver,
    resolverFor: inputId,
    tearDown: tearDown,
    resolvers: resolvers,
  );
}