show method

Future<void> show({
  1. bool inactive = false,
})

Shows and gives focus to the window.

Listeners get onWindowEvent('show') when this call makes a hidden window visible. When no window can be found yet (see bindWindow), the request is kept and carried out on the first window that is found or bound; a later hide cancels it.

Implementation

Future<void> show({bool inactive = false}) async {
  final window = _target;
  if (window == null) {
    _pendingShowInactive = inactive;
    assert(() {
      if (!_didWarnUnresolvedShow) {
        _didWarnUnresolvedShow = true;
        developer.log(
          'show() found no window to show yet; it will be shown once one '
          'is found. Call windowManager.bindWindow() to address the window '
          'explicitly.',
          name: 'window_manager',
        );
      }
      return true;
    }());
    return;
  }
  _showWindow(window, inactive: inactive);
}