captureStepReportArtifacts function
Capture one report screenshot.
Frame-aligned Observer data must be captured inside captureScreenshot,
in the same synchronous turn that freezes the image. A post-capture callback
could observe a later frame and produce mismatched report evidence.
Implementation
Future<bool> captureStepReportArtifacts({
required Future<bool> Function() captureScreenshot,
bool enabled = true,
}) {
if (!enabled) return Future<bool>.value(false);
return RunnerBenchmark.async('workflow', 'captureStepReportArtifacts',
() async {
return captureScreenshot();
});
}