tooltipBuilder property
final
Builds the widget that will be displayed in the tooltip's overlay.
The animation parameter is an Animation that maps to the tooltip's
show and hide animation. Its value goes from 0.0 to 1.0 when the tooltip
is shown, and from 1.0 to 0.0 when it is hidden.
This animation can be used to create custom transitions for the tooltip,
such as fading or scaling, by wrapping the tooltip's content in a
FadeTransition or ScaleTransition and using the provided animation.
The characteristics of the animation, such as its duration and curve, can be customized using the RawTooltip.animationStyle property.
A common use case is to fade the tooltip's content in and out.
link
RawTooltip(
semanticsTooltip: 'An example tooltip',
tooltipBuilder: (BuildContext context, Animation<double> animation) {
return FadeTransition(
opacity: animation,
child: Container(
padding: const EdgeInsets.all(8.0),
color: Colors.grey,
child: const Text('I am a tooltip!'),
),
);
},
child: const Icon(Icons.info),
)
Implementation
final TooltipComponentBuilder tooltipBuilder;