Closed hukjordanjanaq closed 3 years ago
Let me know if this answered your question
I'm using just_the_tooltip: ^0.0.9+1, but it's not hidind after it shows.
It may be because i'm showing it programmatically?
I tested pressing the child for showing the tooltip and it works fine.
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.
I got it! Thank you so much for answering.
Thank you for this great library too. Have a nice day!
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
It works fine, it closes automatically.
Example with showDuration = Duration(milliseconds: 1500)
Thanks yo so much!
😄 Closing
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 specifyisModal
totrue
on the JustTheTooltip construction