getWindowFrame static method

Future<Rect> getWindowFrame()

Returns the window’s window’s frame rectangle in screen coordinates, including the title bar.

Keep in mind that the y-coordinate returned is measured from the bottom of the screen.

Implementation

static Future<Rect> getWindowFrame() async {
  await _completer.future;
  final map =
      await _windowManipulatorMethodChannel.invokeMethod('getWindowFrame');

  return Offset(map['x'], map['y']) & Size(map['width'], map['height']);
}