renderToDocumentInScope function

String renderToDocumentInScope(
  1. BloomNode body, {
  2. required BloomQueryScope scope,
  3. String lang = 'en',
  4. String charset = 'UTF-8',
  5. String? title,
  6. List<BloomNode> head = const [],
  7. String? importMapJson,
  8. List<String> stylesheets = const [],
  9. List<String> scripts = const [],
})

Renders a full document reusing scope as the ambient query cache.

Implementation

String renderToDocumentInScope(
  BloomNode body, {
  required BloomQueryScope scope,
  String lang = 'en',
  String charset = 'UTF-8',
  String? title,
  List<BloomNode> head = const [],
  String? importMapJson,
  List<String> stylesheets = const [],
  List<String> scripts = const [],
}) =>
    BloomData.runWithScope(
      scope,
      () => renderToDocument(
        body,
        lang: lang,
        charset: charset,
        title: title,
        head: head,
        importMapJson: importMapJson,
        stylesheets: stylesheets,
        scripts: scripts,
      ),
    );