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

Callbacks for pointer gestures #1275

Merged
merged 13 commits into from
Jun 15, 2022

Conversation

pmjobin
Copy link
Contributor

@pmjobin pmjobin commented Jun 13, 2022

This allows registering callbacks on pointer-related gestures by adding corresponding properties to the public API. These callbacks are helpful to implement features such as, for instance, drawing a polygonal ROI over a map using the mouse.

@ibrierley
Copy link
Collaborator

Thanks for this, will try and get chance to take a look over the next couple of days!

Copy link
Collaborator

@ibrierley ibrierley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm fine with this change. Don't really see any major negatives, and can't spot any breaking changes..I don't think hover works over a marker, just to be aware, not sure there's any way around that, nor if it's desirable either.

(not directly related, but maybe we should think about bumping a minor version increase to pub.dev soon ?)

Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Haven't tested, but code looks good. Maybe in the future we need a better way of doing this somehow rather than using so many parameters and callbacks.

@JaffaKetchup JaffaKetchup merged commit 19e6509 into fleaflet:master Jun 15, 2022
@ibrierley
Copy link
Collaborator

Hah yes, I was actually thinking exactly the same before, but felt it a bit unfair on just one pull request :D. Gestures are getting a bit unweildy. I had wondered why we didn't just dump all events in one go, rather than separate types. The callbacks as options are maybe a bit trickier. If anyone has any clever ideas, I'm listening!

Thinking out loud...Just looking at https://api.flutter.dev/flutter/widgets/GestureDetector-class.html there's a lot of gestures, could somehow the gesturedetector be exposed, and let everyone do what they want ? Not even sure that makes sense without looking at it a bit more.

@JaffaKetchup
Copy link
Member

Yes, we could allow a gesture detector to be passed in, then override the child property (perhaps by implementing custom copy with if can't be done another way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants