dismissAllToolTips method Null safety

bool dismissAllToolTips()

Dismiss all of the tooltips that are currently shown on the screen.

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) {
      state._dismissTooltip(immediately: true);
    }
    return true;
  }
  return false;
}