metro/live/live_screenshots library

Classes

LiveCell
A locale and theme to capture the app in, from --locales and --themes.
LiveStore
An app store's screenshot size, as the app lists it in status.stores.
PlaybookScreenshotFile
A screenshot a playbook step reported, and where Metro saves it.
PlaybookScreenshotFiles
Decides where the screenshots of one playbook run are saved, one nylo.playbook event at a time, as they arrive.
PlaybookScreenshotSaver
Collects a playbook run's screenshots from app while the run carries on, one at a time in the order their steps ended, and writes them.

Constants

liveScreenshotModes → const List<String>
The screenshots modes playbooks.run takes, from most to least saved.

Functions

liveCells(Map<String, Object?> status, {List<String>? locales, List<String>? themes}) → List<LiveCell>
Every LiveCell for the --locales locales and --themes themes, locales outer and themes inner, checked against the locales and themes the app lists in its status.
liveCellScreenshotPaths({required String root, required String device, required String mode, required DateTime at, required List<LiveCell> cells, String? requested, bool several = false, String suffix = '', bool exists(String path)?}) → List<String>
Where screenshot --locales/--themes saves the capture of each of cells, in the same order.
liveCopyProgram(String file, {String? os, LiveProcesses processes = const LiveProcesses()}) → LiveProgram
The program that copies the PNG file to the clipboard on os (as Platform.operatingSystem names it).
liveOpenProgram(String file, {String? os, LiveProcesses processes = const LiveProcesses()}) → LiveProgram
The program that opens file in the system's image viewer on os (as Platform.operatingSystem names it).
liveOutIsFolder(String requested, {required String root}) → bool
Whether the --out value requested names a folder rather than a file: it ends with a path separator, or is a folder already.
livePngSize(List<int> png) → ({int height, int width})?
The width and height in the header of png, or null when it isn't a PNG.
liveRelativePath(String path, String root) → String
path relative to root when it's inside it, otherwise path.
liveScreenshotBytes(Object? payload) → Uint8List
The PNG in a screenshot.capture or screenshot.get payload.
liveScreenshotPath({required String root, required String device, required String mode, required DateTime at, String? requested, bool several = false, String suffix = '', String extension = '.png', bool exists(String path)?}) → String
Where screenshot saves the capture of device, running in mode, taken at.
liveSlug(String text, {int max = 48}) → String
text as a file name: lowercase letters and digits, with a - for everything in between, at most max characters long.
liveStore(Map<String, Object?> status, String id) → LiveStore
The store id among those the app lists in its status.
renderScreenshotFolders(LiveBlock block, Iterable<String> files) → void
Adds a line for each folder of the screenshot files to block, e.g. ✓ 6 screenshots in screenshots/sign_up_to_dashboard/.
renderScreenshotSummary(LiveBlock block, Iterable<PlaybookScreenshotFile> saved) → void
Adds a line for each folder of saved screenshots to block, e.g. ✓ 6 screenshots in screenshots/sign_up_to_dashboard/.
renderStoreList(LiveBlock block, Map<String, Object?> status, {String use = 'screenshot --store'}) → void
Adds the stores the app lists in its status to block, with use as how to capture at one, e.g. screenshot --store.

Typedefs

LiveProgram = ({List<String> arguments, String executable})
A program to run, with its arguments.