initializeElement method

void initializeElement()

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

Implementation

void initializeElement() {
  addEventSubscription('click', widget.onTap);
  addEventSubscription('pointerdown', widget.onPointerDown);
  addEventSubscription('pointerup', widget.onPointerUp);
  addEventSubscription('pointerenter', widget.onPointerEnter);
  addEventSubscription('pointerleave', widget.onPointerLeave);
  addEventSubscription('pointermove', widget.onPointerMove);
  addEventSubscription('pointercancel', widget.onPointerCancel);
  addEventSubscription('pointerover', widget.onPointerOver);
  addEventSubscription('pointerout', widget.onPointerOut);
  addEventSubscription('mousedown', widget.onMouseDown);
  addEventSubscription('mouseup', widget.onMouseUp);
  addEventSubscription('mouseenter', widget.onMouseEnter);
  addEventSubscription('mouseleave', widget.onMouseLeave);
  addEventSubscription('mousemove', widget.onMouseMove);
  addEventSubscription('mouseover', widget.onMouseOver);
  addEventSubscription('mouseout', widget.onMouseOut);
  addEventSubscription('touchstart', widget.onTouchStart);
  addEventSubscription('touchend', widget.onTouchEnd);
  addEventSubscription('touchmove', widget.onTouchMove);
  addEventSubscription('touchcancel', widget.onTouchCancel);

  if (widget.style == null) {
    element.removeAttribute('style');
  } else {
    element.setAttribute('style', widget.style!.toString());
  }
}