TextVirtualNode constructor

TextVirtualNode(
  1. dynamic rootId,
  2. dynamic id,
  3. dynamic pid,
  4. dynamic index,
  5. dynamic renderContext,
)

Implementation

TextVirtualNode(rootId, id, pid, index, renderContext)
    : super(rootId, id, pid, index, renderContext) {
  if (parent != null) {
    _tapGestureRecognizer = TapGestureRecognizer();
    _tapGestureRecognizer?.onTapDown = (detail) {
      _longClickTimer = Timer(const Duration(milliseconds: 500), () {
        nativeGestureDispatcher.handleLongClick();
      });
      nativeGestureDispatcher.handlePressIn();
    };
    _tapGestureRecognizer?.onTapUp = (e) {
      var longClickTimer = _longClickTimer;
      if (longClickTimer != null && longClickTimer.isActive) {
        nativeGestureDispatcher.handleClick();
        longClickTimer.cancel();
      }
      nativeGestureDispatcher.handlePressOut();
    };
  }
}