Disable longPress without using "enable" parameters
Harrys76 opened this issue · comments
Harrys B. E. Silalahi commented
Describe the bug
I can't disable longPress gesture detector without affecting the textformfield
To Reproduce
Positioned(
top: 0,
left: 0,
right: 0,
child: GestureDetector(
onTap: () {
if (widget.onTap != null) widget.onTap!();
_onFocus();
},
onLongPress: widget.enabled
? () async {
var data = await Clipboard.getData("text/plain");
if (data?.text?.isNotEmpty ?? false) {
if (widget.beforeTextPaste != null) {
if (widget.beforeTextPaste!(data!.text)) {
_showPasteDialog(data.text!);
}
} else {
_showPasteDialog(data!.text!);
}
}
}
: null,`