generateDOMAsyncElement method
T?
generateDOMAsyncElement(
- DOMElement? domParent,
- T? parent,
- DOMAsync domAsync,
- DOMTreeMap<
T> treeMap, - DOMContext<
T> ? context,
Implementation
T? generateDOMAsyncElement(DOMElement? domParent, T? parent,
DOMAsync domAsync, DOMTreeMap<T> treeMap, DOMContext<T>? context) {
T? templateElement;
if (domAsync.loading != null) {
var nodes = DOMNode.parseNodes(domAsync.loading);
if (nodes.isNotEmpty) {
DOMNode rootNode;
if (nodes.length == 1) {
rootNode = nodes.first;
} else {
rootNode = $div(content: nodes);
}
templateElement = build(domParent, parent, rootNode, treeMap, context);
}
}
templateElement ??= createElement('template');
var future = domAsync.resolveFuture!;
return _generateFutureElementImpl(
domParent, parent, domAsync, templateElement, future, treeMap, context);
}