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}) {
if (externalElement == null) return '';
if (externalElement is String) {
return externalElement as String;
} else if (externalElement is DOMElementGenerator) {
var function = externalElement as DOMElementGenerator;
var element = function(parentNode);
return element != null ? '$element' : '';
} else if (externalElement is DOMElementGeneratorFunction) {
var function = externalElement as DOMElementGeneratorFunction;
var element = function();
return element != null ? '$element' : '';
} else {
return '$externalElement';
}
}