loadEventHandlers method

  1. @override
void loadEventHandlers()
override

Loads this component event handlers. Call super to check whether this component has been attached. If it hasn't, it will throw ComponentNotRenderedException.

Because this is a StringComponent, this method is not called as this component never gets rendered independently. The parent needs to call this typically during postRender.

BUG: There might need a way for this to be called automatically after attached.

Implementation

@override
void loadEventHandlers() {
  super.loadEventHandlers();
  _onMouseMoveSubs = _svgElem.onMouseMove.listen(_onMouse);
  _onMouseClickSubs = _svgElem.onClick.listen((event) {
    _onMouse(event);
    _onClick(event);
  });
  _onCaptionClickSubs = _captionElem.onClick.listen((event) {
    hideCaption();
  });
}