Comments (3)
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
Edit
Make sure you're on version 0.0.10. That's the latest one with better controller state handling
from just_the_tooltip.
JustTheTooltip(
onClose: () {},
onOpen: () {}
)
Yeah, that's what I meant
I hope to be added soon, Thank you
from just_the_tooltip.
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
}
),
from just_the_tooltip.
Related Issues (20)
- Get rid of JustTheInterface
- make tooltip not disappear when hovering over the actual tooltip widget
- isModal:true makes the tooltip persistant (on previous page) when a GestureDetector of higher level pushes the navigator to a new route...
- Tooltip doesn't show up, dry layout errors. HOT 2
- Prevent the tooltip from closing on clicking on it HOT 2
- onShow not triggering correctly
- Gesture Detector in other page wont work if the page is redirected from tooltip HOT 1
- isModal does not work, if child is gestureDetector
- Just showing a simple tooltip by default?
- Bad state: This controller has not been attached to a tooltip yet. HOT 5
- Tooltip with Outline Border HOT 1
- clickable content HOT 2
- uses-material-design: true is unnecessary HOT 1
- The size of the content is too big.
- cannot show in nested navigation
- LateInitializationError: Field 'axisDirection' has not been initialized.
- Allow to pass a overlay state to the constructor.
- Controller Issue HOT 3
- Tooltip location issue when page size isn't full width HOT 2
- auto close is not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from just_the_tooltip.