bensonarafat / super_tooltip

SuperTooltip It is super flexible and allows you to display ToolTips in the overlay of the screen.
https://pub.dev/packages/super_tooltip
MIT License
141 stars 95 forks source link

Feature Request: Allow External Control of Tooltip Animation #115

Closed ryannapp-fedex closed 2 months ago

ryannapp-fedex commented 2 months ago

Is your feature request related to a problem? Please describe.

I'm currently using the super_tooltip package and have a scenario where I need to control the showing and hiding of the tooltip based on external factors, such as BLoC events. The current implementation tightly couples the animation process to the internal _showTooltip() method, making it difficult to override or control the animation externally. This limitation hinders my ability to integrate the tooltip's visibility with the state management logic I am using in my application.

For example, I have a scenario where I want the tooltip to appear ONLY when triggered by a BLoC event. In this case, I am able to show the tooltip when triggering a ShowTooltipEvent BUT the tooltip still shows when the user taps on the child widget that the tooltip wraps. It would be great if the tooltip's visibility could be controlled exclusively by things like BLoC events or other external factors, without any interference from the built-in tap handling logic of the SuperTooltip.

Describe the solution you'd like

I would like the ability to customize or override the animation logic within the _showTooltip() method. Specifically, a callback or parameter could be introduced that allows users to control the animation externally. This enhancement would provide flexibility for developers to manage tooltip visibility based on external triggers, such as BLoC events or other state changes, without being restricted by the internal AnimationController.

Describe alternatives you've considered

As a workaround, I considered implementing custom tooltips from scratch or bypassing the animation by manipulating the internal state of the SuperTooltip widget. However, these approaches are not ideal as they require significant changes and do not leverage the existing features provided by the super_tooltip package.

Additional context

Integrating this feature would allow for more dynamic and responsive UI behavior, particularly in applications where state management is handled externally (e.g., using BLoC). This addition would make the super_tooltip package more versatile and applicable to a wider range of use cases.

bensonarafat commented 2 months ago

Thanks @ryannapp-fedex

ryannapp-fedex commented 2 months ago

Hey @bensonarafat -- no pressure at all but do you have a rough estimate on when support for this might be added in? We have a new feature planned for our next release and a big portion of it includes this tooltip. Just wanted to get an idea in case we needed to push this feature back to a following release instead.

bensonarafat commented 2 months ago

@ryannapp-fedex Right now, I don't have enough time to work on it. But if you can, you fork the repo, and add the features, I will review and merge. Thanks for your understanding

ryannapp-fedex commented 2 months ago

@bensonarafat sounds great!

ryannapp-fedex commented 2 months ago

@bensonarafat Just opened up a PR -- lmk if you would like any other changes made

bensonarafat commented 2 months ago

Okay, great @ryannapp-fedex