captureAndSave method
Create screenshot and save it in file. File will be created in directory
specified in Catcher2Options
.
Implementation
Future<XFile?> captureAndSave({
double? pixelRatio,
Duration delay = const Duration(milliseconds: 20),
}) async {
try {
final content = await _capture(
pixelRatio: pixelRatio,
delay: delay,
);
if (content != null) {
return saveFile(content);
}
} catch (exception) {
_logger.warning('Failed to create screenshot file: $exception');
}
return null;
}