initializeElement method

  1. @override
void initializeElement()
override

Called when this Node is added to the tree or after the widget is updated.

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 ?? '';
}