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

exception when used with showModalBottomSheet and tooltipDirection.down #97

Open
righteoustales opened this issue Apr 18, 2024 · 3 comments
Assignees

Comments

@righteoustales
Copy link

righteoustales commented Apr 18, 2024

I'm using super_tootip all over my code base to implement a guided first-time-user tour of the app. I have tooltips running on my main screen, left and right drawers, various dialogs, etc.

My basic pattern is a condition to see if the tooltip should be active and, if so, I call a method that creates it with an associated controller. Just before returning it to the. build () function I call it from I also kick off a postframe callback (WidgetsBinding.instance.addPostFrameCallback((_) specifically) that invokes toolTipController!.showTooltip() using the controller associated with the tooltip that is returned to the build() call.

This pattern has worked flawlessly until I tried to use this pattern from within showModalBottomSheet (which looks a LOT like what I do successfully within showDialog where it works fine). Everything works fine in showModalBottomSheet until the postframecallback calls toolTipController.showTooltip(). If I do not make that call things run fine and I can even successfully show the tooltip if I call toolTipController.sthoTooltip() from an onPressed: callback from a button inside the modal bottom sheet. But, when I let the postframecallback call the same the flutter runtime asserts telling me that something has a negative min height (both max and min height are negative and share the same value - maybe a box constraints calculation isn't working right?).

Is this a known issue? Is there a workaround?

(see below for update)

@righteoustales
Copy link
Author

Quick update that makes me think this is a bug:

Specifying the popupDirection as any of TooltipDirection.left, TooltipDirection.right, TooltipDirection.up all work fine. The exception only occurs when I use TooltipDirection.down.

@righteoustales righteoustales changed the title is super_tooltip compatible with showModalBottomSheet? exception when used with showModalBottomSheet and tooltipDirection.down Apr 18, 2024
@bensonarafat bensonarafat self-assigned this Apr 24, 2024
@righteoustales
Copy link
Author

righteoustales commented May 4, 2024

Update: I saw a couple of other odd anomalies since I first created this bug. One of the other ones I saw was that the tooltip would not show when it should after I switched tabs in a TabBar. After seeing that one, I began to wonder if the underlying issue has to do with animations (since both bottom sheets and tab bars are animated). Sure enough, when I create an animation controller and set the duration to 0 milliseconds all of the anomalies seem to go away.

That said, I have not seen these issues occur while using left/right drawers so far which are also animated.

Hopefully this helps with the debugging of the issue and also as a workaround for others who show up here due to encountering the same issues.

I'll still be watching this for a fix though!

@bensonarafat
Copy link
Owner

@righteoustales
Could you share some code, so i can reproduce this issue.
thank you

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

2 participants