PlaybookCamera constructor

PlaybookCamera({
  1. required PlaybookScreenshots mode,
  2. double pixelRatio = 1.0,
  3. void onShot(
    1. PlaybookShot shot
    )?,
  4. ({String? locale, String? theme})? matrix,
  5. ScreenshotStore? store,
  6. bool frame = false,
  7. Color? background,
  8. PlaybookNative? native,
  9. Future<Screenshot> compose(
    1. Screenshot shot,
    2. String? caption
    )?,
  10. Future<Screenshot> capture(
    1. double pixelRatio
    )?,
  11. PlaybookLook? look,
  12. Future<({List<String> locales, List<String> themes})> looks()?,
})

Creates a camera capturing per mode.

pixelRatio is relative to the device's: 0.5 is half size. capture replaces the screen capture, look replaces ScreenshotLook.show, and looks lists the bundled locales and the themes, for tests.

matrix is the locale and theme Metro switched the app to for this pass of --locales / --themes. A screenshot() step with its own lists then captures only that cell, when its lists include it.

With store or frame, step and marked shots are converted with Screenshot.forStore or Screenshot.framed, on background. Failure shots stay as they are. compose replaces that conversion, for tests.

native asks Metro to capture screenshot() steps. Without it, and in runs with store or frame, which convert the app's own capture, the app captures them.

Implementation

PlaybookCamera({
  required this.mode,
  this.pixelRatio = 1.0,
  this.onShot,
  this.matrix,
  this.store,
  this.frame = false,
  this.background,
  this.native,
  Future<Screenshot> Function(Screenshot shot, String? caption)? compose,
  Future<Screenshot> Function(double pixelRatio)? capture,
  PlaybookLook? look,
  Future<({List<String> locales, List<String> themes})> Function()? looks,
}) : _composeOverride = compose,
     _capture = capture ?? _captureScreen,
     _look = look ?? ScreenshotLook.show,
     _looks = looks ?? _bundledLooks;