Code Monkey home page Code Monkey logo

Comments (3)

stargazing-dino avatar stargazing-dino commented on June 30, 2024

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.

fictionteamapps avatar fictionteamapps commented on June 30, 2024

JustTheTooltip(
onClose: () {},
onOpen: () {}
)

Yeah, that's what I meant
I hope to be added soon, Thank you

from just_the_tooltip.

stargazing-dino avatar stargazing-dino commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.