didAttachRenderer method

  1. @override
void didAttachRenderer()
override

Implementation

@override
void didAttachRenderer() {
  super.didAttachRenderer();

  addEventListener(EVENT_TOUCH_START, _handleEditable);
  addEventListener(EVENT_TOUCH_MOVE, _handleEditable);
  addEventListener(EVENT_TOUCH_END, _handleEditable);
  addEventListener(EVENT_CLICK, _handleEditable);
  addEventListener(EVENT_DOUBLE_CLICK, _handleEditable);
  addEventListener(EVENT_LONG_PRESS, _handleEditable);

  AnimationController animationController = _cursorBlinkOpacityController = AnimationController(vsync: this, duration: _fadeDuration);
  animationController.addListener(_onCursorColorTick);

  addChild(createRenderBox());

  SchedulerBinding.instance!.addPostFrameCallback((_) {
    if (autofocus) {
      focus();
    }
  });
}