lixp185 / bookfx

模拟书籍翻页效果
BSD 3-Clause "New" or "Revised" License
71 stars 16 forks source link

如何解决SelectableText长按失效的问题 #9

Open chinachance opened 6 months ago

chinachance commented 6 months ago

您好,我使用了您写的组件,给我带来了非常大的帮助,但是我碰到一个问题,困扰我一个月还没解决,就是我使用SelectableText,长按无法复制,因为我是小白,我试过在book_fx中监听长按事件 onLongPressStart: (detail) { widget.longPressCallBack?.call(widget.controller.currentIndex,detail); }, onLongPressMoveUpdate: (d) { widget.longPressMoveUpdateCallBack?.call(widget.controller.currentIndex,d); }, onLongPressEnd: (d) { widget.longPressEndCallBack?.call(widget.controller.currentIndex,d); }, 但是我最终还是无法实现,我想问一下作者是否有可行性的方案

lixp185 commented 6 months ago

@chinachance 这里是手势竞争冲突的问题,在最外层套下这个试下MediaQuery( data: MediaQueryData.fromView(View.of(context)) .copyWith(gestureSettings: const DeviceGestureSettings(touchSlop: 8.15)), child: child;)
touchSlop 默认是18像素,把这个值降低试试。