screenstackDriver function

Future<void> screenstackDriver({
  1. String? outDir,
})

Runs the flutter drive host side of a ScreenStack capture.

Full-screen PNGs arrive through onScreenshot; element PNGs and the capture list arrive in the response data. Everything is written to outDir, then SCREENSTACK_OUT_DIR, then the run config's outDir, resolved against the current directory. Output is written even when some screens failed, so the CLI can still upload what was captured.

Implementation

Future<void> screenstackDriver({String? outDir}) async {
  final screenshots = <String, List<int>>{};
  final device = await DeviceScreenshotter.start(Platform.environment);
  try {
    await _drive(screenshots, device, outDir);
  } finally {
    await device?.stop();
  }
}