build method
dynamic
build(
- Object? context, {
- bool asElement = true,
- bool resolveDSX = true,
- QueryElementProvider? elementProvider,
- IntlMessageResolver? intlMessageResolver,
override
Implementation
@override
dynamic build(Object? context,
{bool asElement = true,
bool resolveDSX = true,
QueryElementProvider? elementProvider,
IntlMessageResolver? intlMessageResolver}) {
if (elementProvider == null) return '';
var element = elementProvider(query)!;
if (element == null) {
return null;
} else if (element is String) {
if (!asElement) {
return element;
}
var template = DOMTemplate.parse(element);
if (!template.hasOnlyContent) {
return template.build(context,
asElement: true,
resolveDSX: resolveDSX,
elementProvider: elementProvider,
intlMessageResolver: intlMessageResolver);
} else {
return element;
}
} else {
return asElement ? element : DOMTemplateVariable.valueToString(element);
}
}