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

feat: Allow the passthrough of pointer events inside the highlighted area #17

Merged
merged 3 commits into from Sep 27, 2021

Conversation

Termtime
Copy link
Contributor

@Termtime Termtime commented Sep 18, 2021

In my use case, I require the user to click some buttons inside the highlighted area, afterwards I wanted to continue the showcase, so what I did is:

  • Added PassthroughMode enum that declares the behavior of the passthrough, by default RelativeBubbleSlide uses the PassthroughMode.NONE option which absorbs all pointer events and advances the showcase, as it currently is doing.
  • When PassthroughMode.INSIDE_WITH_NOTIFICATION is used, several things happen:
    • A CustomClipper is used instead of a CustomPainter, which clips around the highlighted area, leaving the highlighted area exposed to pointer events
    • The default behavior of continuing the showcase when the user clicks anywhere is removed. To continue the showcase, the user MUST dispatch a BubbleShowcaseNotification Notification that lets the BubbleShowcase object know that it should continue.
      • This is thought so the user can easily do async tasks and then notifiy the BubbleShowcase when it should continue.
      • Pretty useful as well if you want to wrap the BubbleSlide with a GestureRecognizer to override the default behavior of the button or element you want the user to interact with.
  • Added the option of "padding" (Default of 0, like it currently is) to the highlighted area. The amount of padding is added to the Position that is gotten from the highlighted widget.
  • Updated the example with a 4th slide which includes highlightPadding and PassthroughMode.INSIDE_WITH_NOTIFICATION
  • Made a comment regarding the initialDelay property be a doc comment instead of being a normal comment.

Default current behavior is retained while adding the new options and functionality.

@Termtime
Copy link
Contributor Author

@Skyost Check it out when you can and LMK if you require anything else.

@Skyost
Copy link
Owner

Skyost commented Sep 20, 2021

Will check this week 👍

@Skyost Skyost merged commit 13d5ab3 into Skyost:master Sep 27, 2021
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.

None yet

2 participants