Using this code I could get a screenshot of a whole screen, but how do I get a screenshot of a specific application using dart on a desktop operating system?? (https://stackoverflow.com/questions/51117958/how-to-take-a-screenshot-of-the-current-widget-flutter#:~:text=To%20take%20a%20screenshot%20of%20your%20widget%2C%20make,app%20folder%2C%20and%20run%20your%20widget%2C%20like%20this%3A - not really a whole either, at least not on a desktop operating system)
RenderRepaintBoundary boundary = previewContainer.currentContext.findRenderObject();
ui.Image image = await boundary.toImage();
final directory = (await getApplicationDocumentsDirectory()).path;
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();
print(pngBytes);
File imgFile =new File('$directory/screenshot.png');
imgFile.writeAsBytes(pngBytes);