setLevel static method

Future<void> setLevel(
  1. NSWindowLevel level
)

Sets the level of the window.

Each level in the list groups windows within it in front of those in all preceding groups. Floating windows, for example, appear in front of all normal-level windows. When a window enters a new level, it’s ordered in front of all its peers in that level.

Usage examples:

// Set the window to appear in front of all normal-level windows:
WindowManipulator.setLevel(NSWindowLevel.floating);

// Set the window to appear behind all normal-level windows:
WindowManipulator.setLevel(NSWindowLevel.normal.withOffset(-1));

// Reset the window's level to the default value:
WindowManipulator.setLevel(NSWindowLevel.normal);

Implementation

static Future<void> setLevel(NSWindowLevel level) async {
  await _completer.future;
  await _windowManipulatorMethodChannel.invokeMethod('setLevel', {
    'base': level.baseName,
    'offset': level.offset,
  });
}