ensureTooltipVisible method Null safety

bool ensureTooltipVisible()

Shows the tooltip if it is not already visible.

Returns false when the tooltip shouldn't be shown or when the tooltip was already visible.

Implementation

bool ensureTooltipVisible() {
  if (!_visible || !mounted) {
    return false;
  }
  _showTimer?.cancel();
  _showTimer = null;
  _forceRemoval = false;
  if (_isConcealed) {
    if (_mouseIsConnected) {
      Tooltip._concealOtherTooltips(this);
    }
    _revealTooltip();
    return true;
  }
  if (_entry != null) {
    // Stop trying to hide, if we were.
    _dismissTimer?.cancel();
    _dismissTimer = null;
    _controller.forward();
    return false; // Already visible.
  }
  _createNewEntry();
  _controller.forward();
  return true;
}