captureSingleScreenshot method

Future<File> captureSingleScreenshot()

Implementation

Future<File> captureSingleScreenshot() async {
  final Uint8List screenshotBytes = await _captureSingleFrame();
  final directory = await getTemporaryDirectory();
  final String fileName = '${DateTime.now().millisecondsSinceEpoch}.png';
  final File screenshotFile = File('${directory.path}/$fileName');
  await screenshotFile.writeAsBytes(screenshotBytes);
  return screenshotFile;
}