render method
Renders the component for SSR (Server-Side Rendering).
Wraps the result of build in the component's custom element tag and includes a declarative shadow root template.
Note: Do not override this method in subclasses. Override build instead to define your component's content.
Implementation
@override
html.Element render() {
if (kIsBrowser) {
// On the browser, we only want the host element.
// The hydration process will handle the shadow root and its content.
return html.element(tagName, [], attributes: dumpedAttributes);
}
final children = _buildWithStyles();
return html.element(tagName, [
html.template(shadowrootmode: 'open', children),
], attributes: dumpedAttributes);
}