buildHTML method
String
buildHTML({
- bool withIndent = false,
- String parentIndent = '',
- String indent = ' ',
- bool disableIndent = false,
- bool xhtml = false,
- bool resolveDSX = false,
- bool buildTemplates = false,
- DOMNode? parentNode,
- DOMNode? previousNode,
- DOMContext? domContext,
override
Generates a HTML from this node tree.
withIndent
If true
will generate a indented HTML.
Implementation
@override
String buildHTML(
{bool withIndent = false,
String parentIndent = '',
String indent = ' ',
bool disableIndent = false,
bool xhtml = false,
bool resolveDSX = false,
bool buildTemplates = false,
DOMNode? parentNode,
DOMNode? previousNode,
DOMContext? domContext}) {
String? html;
if (resolveDSX) {
if (template.isDSX) {
html = template.buildAsString(domContext,
resolveDSX: true,
intlMessageResolver: domContext?.intlMessageResolver);
} else if (template.hasDSX) {
var template2 = template.copy(resolveDSX: true);
if (buildTemplates) {
var built = template2.build(domContext,
asElement: false,
resolveDSX: true,
intlMessageResolver: domContext?.intlMessageResolver);
html = DOMTemplate.objectToString(built);
} else {
html = template2.toString();
}
}
}
if (html == null) {
if (buildTemplates) {
html = template.buildAsString(domContext,
resolveDSX: resolveDSX,
intlMessageResolver: domContext?.intlMessageResolver);
} else {
html = text;
}
}
var nbsp = xhtml ? ' ' : ' ';
return html.replaceAll('\xa0', nbsp);
}