WPopup
WPopup copied to clipboard
当被包裹的widget没有设置背景色时,无法触发
应当给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();
}
},
),
);
}