WPopup icon indicating copy to clipboard operation
WPopup copied to clipboard

当被包裹的widget没有设置背景色时,无法触发

Open ashamp opened this issue 5 years ago • 0 comments

应当给GestureDetector设置behavior: HitTestBehavior.opaque属性

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: (){
        if(entry != null){
          removeOverlay();
        }
        return Future.value(true);
      },
      child: GestureDetector(
        child: widget.child,
        behavior: HitTestBehavior.opaque, 
        onTap: () {
          if (widget.pressType == PressType.singleClick) {
            onTap();
          }
        },
        onLongPress: () {
          if (widget.pressType == PressType.longPress) {
            onTap();
          }
        },
      ),
    );
  }

ashamp avatar Oct 14 '20 19:10 ashamp