compileStringAsync function

Future<String> compileStringAsync (String source, { Syntax syntax, bool color: false, Logger logger, Iterable<AsyncImporter> importers, SyncPackageResolver packageResolver, Iterable<String> loadPaths, Iterable<AsyncCallable> functions, OutputStyle style, AsyncImporter importer, dynamic url, void sourceMap(SingleMapping map), @Deprecated("Use syntax instead.") bool indented: false })

Like compileString, except it runs asynchronously.

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

Implementation

Future<String> compileStringAsync(String source,
    {Syntax syntax,
    bool color = false,
    Logger logger,
    Iterable<AsyncImporter> importers,
    SyncPackageResolver packageResolver,
    Iterable<String> loadPaths,
    Iterable<AsyncCallable> functions,
    OutputStyle style,
    AsyncImporter importer,
    url,
    void sourceMap(SingleMapping map),
    @Deprecated("Use syntax instead.") bool indented = false}) async {
  var result = await c.compileStringAsync(source,
      syntax: syntax ?? (indented ? Syntax.sass : Syntax.scss),
      logger: logger ?? Logger.stderr(color: color),
      importers: importers,
      packageResolver: packageResolver,
      loadPaths: loadPaths,
      functions: functions,
      style: style,
      importer: importer,
      url: url,
      sourceMap: sourceMap != null);
  if (sourceMap != null) sourceMap(result.sourceMap);
  return result.css;
}