tooltipConstraints method
The Tooltip.constraints that the package's default controls use: the ones Tooltip would use (the
theme's constraints, else a minimum height from the theme or Flutter's default), limited to
tooltipMaxWidth of the window, so that long text wraps on the column's inner side instead of covering
the column. Pass it with tooltipPosition to give an application control the same tooltip.
Implementation
BoxConstraints tooltipConstraints(BuildContext context) {
final theme = TooltipTheme.of(context);
final constraints =
theme.constraints ??
BoxConstraints(
// Tooltip's own fallback still honours the deprecated theme height, so these tooltips do too.
// ignore: deprecated_member_use
minHeight: theme.height ?? _defaultTooltipHeight(Theme.of(context).platform),
);
return constraints.enforce(BoxConstraints(maxWidth: tooltipMaxWidth(MediaQuery.sizeOf(context).width)));
}