PlaybookCamera class

Takes a playbook run's screenshots once each step settles.

Every Metro run has one, saving the screenshot() steps and failing steps unless --screenshots asks for more or less. A run from code gets one with run(onScreenshot: ...). Shots go to onShot when it's given, and otherwise wait in the app until Metro collects them with screenshot.get.

Constructors

PlaybookCamera({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<String> locales, List<String> themes})> looks()?})
Creates a camera capturing per mode.

Properties

background → Color?
The color behind a converted shot.
final
frame → bool
Whether step and marked shots are drawn in a phone outline.
final
hashCode → int
The hash code for this object.
no setterinherited
matrix → ({String? locale, String? theme})?
The locale and theme of this pass of a Metro matrix, or null.
final
mode → PlaybookScreenshots
Which screens are captured.
final
native → PlaybookNative?
Asks Metro for a native capture, or null when nothing can take one.
final
onShot → void Function(PlaybookShot shot)?
Receives each shot instead of the app holding it for Metro.
final
pixelRatio → double
The size relative to the device: 1.0 is the screen's own resolution.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
store → ScreenshotStore?
The store size step and marked shots are converted to, or null.
final

Methods

afterFailure() → Future<PlaybookShot?>
Takes the shot of a failing step as it is, unless the run captures nothing.
afterStep(PlaybookStep step, PlaybookActor actor, {required bool everyStep}) → Future<List<PlaybookShot>>
Takes the shot for step, which actor just performed, when this run captures it. everyStep is false for a playbook with screenshot() steps. The shot waits for running animations to finish, so a tap that opens a page shows the page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

collect(String id) → PlaybookShot?
Removes and returns the held shot id, or null when there's none.
hasMarks(List<PlaybookStep> steps) → bool
Whether a step list contains screenshot() steps, including inside its scenes.
reset() → void
Drops every held shot.

Constants

maxHeld → const int
How many shots the app holds for Metro before dropping the oldest.