render method
Renders the elements of this component.
Accepted return types:
webUINodeandUIElement.- DIVElement, DOMNode, AsDOMElement and AsDOMNode.
- Future.
- UIAsyncContent.
- String, parsed as
HTML. - Map (rendered as JSON).
- List with previous types (recursively).
- Function that returns any previous type. Including Function<Future>, allowing
asyncfunctions.
Implementation
@override
dynamic render() {
var closeButton = showCloseButton ? renderCloseButton() : null;
var cssAutoScrollY = autoScrollY ? ' overflow-y: auto;' : '';
var cssAutoScrollX = autoScrollX ? ' overflow-x: auto;' : '';
var cssAutoScroll = '$cssAutoScrollY$cssAutoScrollX';
if (fullScreen) {
return $div(
style:
'text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-height: calc(100vh - 8px); max-width: calc(100vw - 8px);$cssAutoScroll',
content: [closeButton, renderContent()],
);
} else {
return $div(
style: 'text-align: center;$cssAutoScroll',
content: [closeButton, renderContent()],
);
}
}