initializeElement method
Implementation
@override
void initializeElement() {
super.initializeElement();
addEventSubscription(
type: 'error',
callback: widget.onError,
eventTransformer: (final html.Event event) =>
EventDetails(event, targetNode: this),
);
element
..src = widget.source
..alt = widget.alternativeText ?? '';
}