resolveSource<T> function Null safety

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

A convenience method for using resolveSources with a single source file.

Implementation

Future<T> resolveSource<T>(
  String inputSource,
  FutureOr<T> Function(Resolver resolver) action, {
  AssetId? inputId,
  PackageConfig? packageConfig,
  Future<Null>? tearDown,
  Resolvers? resolvers,
}) {
  inputId ??= AssetId('_resolve_source', 'lib/_resolve_source.dart');
  return _resolveAssets(
    {
      '${inputId.package}|${inputId.path}': inputSource,
    },
    inputId.package,
    action,
    packageConfig: packageConfig,
    resolverFor: inputId,
    tearDown: tearDown,
    resolvers: resolvers,
  );
}