takeScreenshot method

Future<Uint8List?> takeScreenshot({
  1. bool activeWindowOnly = false,
})

Takes a screenshot.

  • activeWindowOnly: If true, only the currently focused window will be captured. If false, the entire screen will be captured. Default is false.

Returns a Uint8List containing the image data in PNG format.

Implementation

Future<Uint8List?> takeScreenshot({bool activeWindowOnly = false}) async {
  return await _channel.invokeMethod<Uint8List>('takeScreenshot', {
    'activeWindowOnly': activeWindowOnly,
  });
}