StringRenderer constructor

StringRenderer({
  1. bool html5 = true,
  2. bool pretty = true,
  3. String doctype = 'html',
  4. String whitespace = ' ',
})

Initializes a new StringRenderer.

If html5 is not false (default: true), then self-closing elements will be rendered with a slash before the last angle bracket, ex. <br />. If pretty is true (default), then whitespace (default: ' ') will be inserted between nodes. You can also provide a doctype (default: html).

Implementation

factory StringRenderer(
        {bool html5 = true,
        bool pretty = true,
        String doctype = 'html',
        String whitespace = '  '}) =>
    pretty == true
        ? _PrettyStringRendererImpl(
            html5: html5 != false, doctype: doctype, whitespace: whitespace)
        : _StringRendererImpl(html5: html5 != false, doctype: doctype);