Skip to content

Tooltip widget should provide a callback argument #103780

@doppio

Description

@doppio

Use case

I'm interested in sending analytics events when a user triggers a tooltip, but it looks like this isn't possible without a somewhat hacky workaround, like:

  • Essentially reimplementing Tooltip with the callback functionality
  • Using a Stack to overlay a GestureDetector on top of the tooltip widget
  • Adding a new GestureDetector as the immediate child of the Tooltip -- this seems like a hacky solution

Proposal

It seems Tooltip should offer an onTriggered void callback that gets invoked when the user activates it.

Metadata

Metadata

Labels

c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions