-
Notifications
You must be signed in to change notification settings - Fork 51
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
Trigger an action on tap and on dismissed #41
Comments
Hi ! Yeah, you can do that with a controller now. Here's some code: @override
void initState() {
// Programatically display tooltip after two seconds
Future.delayed(const Duration(seconds: 2), () {
tooltipController.showTooltip(immediately: false);
});
tooltipController.addListener(() {
// Prints the enum value of [TooltipStatus.isShowing] or [TooltipStatus.isHiding]
if (tooltipController.value == TooltipStatus.isShowing) {
// my logic
}
});
} You'll just need to create a controller as you would any other and pass it through the JustTheTooltip constructor. If you mean it'd be cool to have callbacks on the actual constructor: JustTheTooltip(
onClose: () {},
onOpen: () {}
) that's another thing and I'd gladly look at a PR EditMake sure you're on version 0.0.10. That's the latest one with better controller state handling |
JustTheTooltip( Yeah, that's what I meant |
Thank you the suggestion. 0.0.11 now has these callbacks. For any issues with them, please raise a new issue. Thank you ! JustTheTooltip(
onDismiss: () {
// do something
},
onShow: () {
// something else
}
), |
No description provided.
The text was updated successfully, but these errors were encountered: