Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Disable longPress without using "enable" parameters #70

Open
Harrys76 opened this issue Jan 4, 2023 · 0 comments
Open

Disable longPress without using "enable" parameters #70

Harrys76 opened this issue Jan 4, 2023 · 0 comments

Comments

@Harrys76
Copy link

Harrys76 commented Jan 4, 2023

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,`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant