dismissAllToolTips static method

bool dismissAllToolTips()

Dismiss all of the tooltips that are currently shown on the screen, including those with mouse cursors currently hovering over them.

This method returns true if it successfully dismisses the tooltips. It returns false if there is no tooltip shown on the screen.

Implementation

static bool dismissAllToolTips() {
  if (_openedTooltips.isNotEmpty) {
    // Avoid concurrent modification.
    final List<TooltipState> openedTooltips = _openedTooltips.toList();
    for (final TooltipState state in openedTooltips) {
      assert(state.mounted);
      state._scheduleDismissTooltip(withDelay: Duration.zero);
    }
    return true;
  }
  return false;
}