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 possible auto close after show? #39

Closed
hukjordanjanaq opened this issue Oct 14, 2021 · 9 comments
Closed

is possible auto close after show? #39

hukjordanjanaq opened this issue Oct 14, 2021 · 9 comments

Comments

@hukjordanjanaq
Copy link

No description provided.

@stargazing-dino
Copy link
Owner

The default tooltip closes after it is opened. It mimics the behaviour of the default Flutter Tooltip. In contrast, if you want to keep the tooltip open after it has shown, you'll need to specify isModal to true on the JustTheTooltip construction

JustTheTooltip(
  isModal: false, // fale is the default. This will hide the tooltip after `showDuration`
)

@stargazing-dino
Copy link
Owner

Let me know if this answered your question

@hukjordanjanaq
Copy link
Author

I'm using just_the_tooltip: ^0.0.9+1, but it's not hidind after it shows.
Captura de Pantalla 2021-10-13 a la(s) 22 18 08

tooltip.mov

@hukjordanjanaq
Copy link
Author

It may be because i'm showing it programmatically?

I tested pressing the child for showing the tooltip and it works fine.

@stargazing-dino
Copy link
Owner

stargazing-dino commented Oct 14, 2021

Sorry, can't go fully into this rn. Maybe this weekend. I will point out where I think the issue is though.

In this function in a regular tooltip press it handles the tooltip dismissal.
https://github.com/Nolence/just_the_tooltip/blob/a143964b91642e2a0ac6624b878994a3b138f49f/lib/src/just_the_tooltip.dart#L523

Because a controller _showTooltip never triggers a mouse click event, those _hideTooltip functions are never called which then never set a timer for dismissal. I think the correct option would to pass the controller showTooltip a field that defines the behavior of the tooltip after opened.

@hukjordanjanaq
Copy link
Author

I got it! Thank you so much for answering.

Thank you for this great library too. Have a nice day!

@stargazing-dino
Copy link
Owner

Alright, I finally got to this and added an autoClose field to the controller's showTooltip.

controller.showTooltip(immediately: true, autoClose: true);

Note, you'll be limited how long it stays open by either your hoverShowDuration or your showDuration. I forget which ones which.

This update is hidden behind 0.0.10-dev so you have to opt into it by specifying that exact version in your pubspec.yaml

Let me know if something sucks. I still need at least one or two more tests before I put stable

@hukjordanjanaq
Copy link
Author

It works fine, it closes automatically.

Example with showDuration = Duration(milliseconds: 1500)

Grabacion.de.pantalla.2021-10-22.a.la.s.12.09.49.mov

Thanks yo so much!

@stargazing-dino
Copy link
Owner

😄 Closing

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