PlaybookCamera constructor
- required PlaybookScreenshots mode,
- double pixelRatio = 1.0,
- void onShot(
- PlaybookShot shot
- ({String? locale, String? theme})? matrix,
- ScreenshotStore? store,
- bool frame = false,
- Color? background,
- PlaybookNative? native,
- Future<
Screenshot> compose(- Screenshot shot,
- String? caption
- Future<
Screenshot> capture(- double pixelRatio
- PlaybookLook? look,
- Future<
({List< looks()?,String> locales, List<String> themes})>
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;