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

Is there a way to set the offset for the tooltip? #106

Open
Neicul123 opened this issue Jul 14, 2024 · 3 comments
Open

Is there a way to set the offset for the tooltip? #106

Neicul123 opened this issue Jul 14, 2024 · 3 comments
Assignees

Comments

@Neicul123
Copy link

Hi!

Thanks a lot for creating and maintaining this package. It seems great so far, but I'm running into a small issue:

The tooltip is always centered on the child widget, and no tap to dismiss is possible on half of the child due to this. In the screenshot you can see the area of the tooltip arrow preventing the dismissal. If I set the arrow size to 0, it sadly does not help, as the tooltip itself just gets put where the arrow was (at the center).

Screenshot 2024-07-15 at 00 12 42

I did some quick digging in the code, and saw a verticalOffset parameter, which seems to be what I'm searching for, but it's commented out and doesn't influence anything at the moment I think.

Is there any other way I can add some offset, or get the click/tap to go through that region as well? Thanks in advance!

@KennedyChiang
Copy link

Hi @Neicul123, I faced the same issue and came up with a workaround.

Original:

SuperTooltip(
    controller: superTooltipController,
    popupDirection: TooltipDirection.up,
    ...
    ...
    child: TargetWidget(),
),

The SuperTooltip would always place the arrow in the middle of the widget.

I just added a SizedBox.shrink() as my TargetWidget and wrapped it in a Row or Column, depending on the TooltipDirection.

Example below:

Row(
    children: [
        SuperTooltip(
            controller: superTooltipController,
            popupDirection: TooltipDirection.up,
            ...
            ...
            // Temporary workaround to address the issue where SuperTooltip obstructs part of the touch area for some of buttons.
            child: const SizedBox.shrink(),
        ),
        TargetWidget(),
    ],
),

This way, the SuperTooltip will never obstruct part of the touch area on the TargetWidget.

It’s not a great solution, but it works. 😅

@bensonarafat
Copy link
Owner

@Neicul123
I will look into the verticalOffset, if @KennedyChiang solution works for you consider that.
When I have enough time. I will look into it.

@Neicul123
Copy link
Author

@KennedyChiang Thanks, that seems to work! Appreciate it!

@bensonarafat Thanks as well!

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

No branches or pull requests

3 participants