resolveAsset<T> function Null safety

Future<T> resolveAsset<T>(
  1. AssetId inputId,
  2. FutureOr<T> action(
    1. Resolver resolver
    ),
  3. {PackageConfig? packageConfig,
  4. Future<Null>? tearDown,
  5. Resolvers? resolvers}
)

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

Implementation

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