Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onSecondaryTap (right-click for windows) callback #1444

Closed
3 tasks done
Richard-Walter opened this issue Feb 8, 2023 · 2 comments · Fixed by #1448
Closed
3 tasks done

Add onSecondaryTap (right-click for windows) callback #1444

Richard-Walter opened this issue Feb 8, 2023 · 2 comments · Fixed by #1448
Labels
feature This issue requests a new feature

Comments

@Richard-Walter
Copy link

What do you want implemented?

Please add the onSecondaryTap click callback so windows users can capture a right-click event when clicking on the map.

What other alternatives are available?

Currently, having to use the onLongPresss callback but this is not intuitive too windows users:

    onLongPress: (tapPosition, point) {

        showDialog(
            context: context,
            builder: (BuildContext context) {
              return MapContextMenuDialog(tapPosition: LatLng(point.latitude, point.longitude));
            });
      },

Can you provide any other information?

See https://api.flutter.dev/flutter/widgets/GestureDetector/onSecondaryTap.html

Heres a package that is capturing a right-click event to display a context menu: https://pub.dev/packages/native_context_menu.

Platforms Affected

Windows, MacOS, Linux

Severity

Annoying: Currently have to use workarounds

Requirements

@Richard-Walter Richard-Walter added the feature This issue requests a new feature label Feb 8, 2023
@TesteurManiak
Copy link
Collaborator

Hi @Richard-Walter, I've investigated a bit on how to implement this feature, unfortunately it's not as easy as it seems because of a dependency to the package positioned_tap_detector_2 which hasn't been updated to support the onSecondaryTap event.

If we want to implement this feature we'll have to re-implement the PositionedTapDetector2 widget by ourselves, which might not be a bad thing as we would rely on one less dependency but implies a bit of work.

@Richard-Walter
Copy link
Author

Richard-Walter commented Feb 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants