compileToResultAsync function Null safety

Future<CompileResult> compileToResultAsync(
  1. String path,
  2. {bool color = false,
  3. Logger? logger,
  4. Iterable<AsyncImporter>? importers,
  5. PackageConfig? packageConfig,
  6. Iterable<String>? loadPaths,
  7. Iterable<AsyncCallable>? functions,
  8. OutputStyle? style,
  9. bool quietDeps = false,
  10. bool verbose = false,
  11. bool sourceMap = false}

Like compileToResult, except it runs asynchronously.

Running asynchronously allows this to take AsyncImporters rather than synchronous Importers. However, running asynchronously is also somewhat slower, so compileToResult should be preferred if possible.


Future<CompileResult> compileToResultAsync(String path,
        {bool color = false,
        Logger? logger,
        Iterable<AsyncImporter>? importers,
        PackageConfig? packageConfig,
        Iterable<String>? loadPaths,
        Iterable<AsyncCallable>? functions,
        OutputStyle? style,
        bool quietDeps = false,
        bool verbose = false,
        bool sourceMap = false}) =>
        logger: logger,
        importCache: AsyncImportCache(
            importers: importers,
            logger: logger ?? Logger.stderr(color: color),
            loadPaths: loadPaths,
            packageConfig: packageConfig),
        functions: functions,
        style: style,
        quietDeps: quietDeps,
        verbose: verbose,
        sourceMap: sourceMap);