injectHtmlTo method
Injects the HTML representation of this SizedBox into the parent element.
Only executes if running on Web (kIsWeb == true).
Creates a <div> element, assigns it a unique ID, and
recursively injects its child (if it implements SeoInjectable or SeoInjectableLayout).
Implementation
@override
void injectHtmlTo(WebHTMLElement parent) {
if (!kIsWeb) return;
final document = webWindow.document;
// Create a div element for HTML structure
final divSizedbox = document.createElement('div') as WebHTMLDivElement;
divSizedbox.id = _generateRandomId();
divSizedbox.style.width = width.toString();
divSizedbox.style.height = height.toString();
// Recursively inject child if present
if (child != null) {
_appendWidgetToContainer(child!, divSizedbox);
}
// Append this container to the parent HTML element
parent.appendChild(divSizedbox);
}