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

Bubble indicator follow mouse on desktop #27

Closed
MostHated opened this issue Jul 28, 2019 · 3 comments
Closed

Bubble indicator follow mouse on desktop #27

MostHated opened this issue Jul 28, 2019 · 3 comments

Comments

@MostHated
Copy link

MostHated commented Jul 28, 2019

I have been playing around with trying to have a desktop feature in which when you mouse over the indicator will automatically pop up and follow the mouse without having to click and hold. I added a bool called mouseHover = false by default. I almost have it working, but its behavior is quite peculiar, as you can see in the link below.

In this gif I am not clicking the mouse at all, the bubble keeps going up and down on its own, I am simply moving the mouse with snap off. At first when I mouseover, it goes at probably 20 times a second quickly than repeats slowly
https://i.imgur.com/1bLcMuc.gifv

I am not quite sure what needs to be changed. This is my first project trying to learn Dart/Flutter, I only started using them a week or two so ago, so I feel I just don't have the experience yet to narrow it down. Any input on it would be greatly appreciated.

Thanks,
-MH

:671   child: Listener(
        onPointerHover: (_displayIndicator && widget.config.mouseHover)
            ? (PointerHoverEvent details) =>
                _refreshPosition(LongPressMoveUpdateDetails(
                  globalPosition: details.localPosition,
                  offsetFromOrigin: Offset.zero,
                ))
            : null,
        onPointerEnter: (!_displayIndicator && widget.config.mouseHover)
            ? (PointerEnterEvent details) =>
                _onDisplayIndicator(LongPressStartDetails(
                  globalPosition: details.localPosition,
                ))
            : null,
@diegoveloper
Copy link
Collaborator

is this an issue about the current library?

@MostHated
Copy link
Author

MostHated commented Jul 30, 2019

Technically, no? The code above was code I was trying to implement myself but was hoping perhaps you might have some insight as to what I might be able to do to keep the bubble from repeatedly appearing and disappearing on its own. If not, I understand, this is something custom I really wanted personally.

I was just trying to use the listener that you already had in the graph code to listen for OnMouseEnterEvent and make the bubble appear and then follow the mouse the entire time until OnMouseExitEvent is called, then it would hide it.

@diegoveloper
Copy link
Collaborator

if you check the code, the method _onDisplayIndicator has the _animationController.forward , for that reason you see the animation of the bubble, you can create another method and remove that line.

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

No branches or pull requests

2 participants