Skip to content

Custom Overlay for Tooltip Widget #45034

Description

@BharathMG

Internal: b/148141781

Use case

I want to provide a "bubble" in the bottom of Tooltip. And also, "X" icon to close the tooltip. Currently, Tooltip class doesn't provide any property to customize overlay. It is showing a simple Text widget inside a ConstrainedBox. It also lacks a way of showing/hiding tooltip programmatically.

I'm achieving my use case with basically copying the whole Tooltip class and changing the _TooltipOverlay build method.

Tooltip decoration property is only useful to change the shape and background color. There is also no way to show/hide tooltip programmatically.

Proposal

How about providing a overlay parameter in Tooltip?
If it is not provided, _TooltipOverlay can be used as a default overlay.

I would be happy to give a PR with tests. I don't want to copy the whole Tooltip class from the framework to just modify a single method!

And also, exposing show/hide tooltip would make the widget very much useful!

Activity

  1. added
    p: material_uimaterial_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    on Nov 18, 2019
  2. lokesh-osian commented on Nov 21, 2019

    @lokesh-osian

    As well as it will be better to add onTap() function along with the onLongPress(), to show the tooltip even on normal click.

  3. lokesh-osian commented on Nov 22, 2019

    @lokesh-osian

    @BharathMG, Can you please provide me with the _TooltipOverlay build method. Because I also wanted to achieve the same. It will be helpful for me if you can share the code with me.

  4. added
    P3Issues that are less important to the Flutter project
    on Dec 11, 2024
  5. github-actions commented on Jan 22, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: mulligan (g3)frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions