You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7c3dd07
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
# Changelog
2
2
3
+
## 1.2.0
4
+
5
+
Shots drawn as iOS, a `--widget` at its own size, and a way to clear old runs.
6
+
7
+
*`shutter shot --platform ios` (and `semantics`) draws every preview as iOS instead of Android, the platform `flutter test` runs as: `defaultTargetPlatform` is `iOS` while each preview is shot, so a theme without its own `platform`, the back button, page transitions, adaptive widgets, and the app's own `defaultTargetPlatform` checks draw as on an iPhone. `shot` prints it, `manifest.json` records it, and `diff` prints both runs' when they differ. It is not part of shot ids.
8
+
*`shutter shot --widget <expression> --size unbounded` lays the widget out with neither dimension bounded and shoots it at its own size, however wide; without `--size`, its width still stops at the viewport's 800.
9
+
*`shutter prune --keep <n>` deletes every run under `.dart_tool/shutter/runs/` but the newest n, and prints the run directories it removed and kept. A run still being shot is left as it is.
10
+
3
11
## 1.1.1
4
12
5
13
Host fallback fonts for any script the host has a font for, and in text whose style keeps them out.
Each is followed by `--settle` milliseconds; shoot again with another `--settle` for another point of an animation.
153
153
`--capture screen` holds the whole viewport, with the menus, dialogs, and tooltips the app draws above the preview.
154
154
`--keyboard <height>` lays a screen out as with its on-screen keyboard up, which `--enter` does not raise; the keyboard itself is not drawn, and `--keyboard-tint 9E9E9E` paints its area gray.
155
+
`--platform ios` draws the app as iOS instead of Android, the platform `flutter test` runs as: the theme, the back button, page transitions, and adaptive widgets follow.
|`doctor`| Check the Flutter SDK version, its font cache, and the project's shell (`--shell`). |
163
-
|`init`| Write `<preview dir>/shell.dart`, or the `--shell` file. |
164
-
|`shot`| Render the named preview files, or one `--widget`, into a new run (`--widget`/`--import`/`--size`, `--settle`, `--shell`, `--tap`/`--enter`/`--press`/`--hover`/`--focus`, `--capture`/`--viewport`, `--keyboard`/`--keyboard-tint`, `--network-image`). |
165
-
|`semantics`| Draw the semantics tree of the same subjects into a new run, with the options of `shot` except `--keyboard-tint`. |
166
-
|`diff <a> <b>`| Compare two runs (`--images`, `--composite`). |
|`doctor`| Check the Flutter SDK version, its font cache, and the project's shell (`--shell`). |
164
+
|`init`| Write `<preview dir>/shell.dart`, or the `--shell` file. |
165
+
|`shot`| Render the named preview files, or one `--widget`, into a new run (`--widget`/`--import`/`--size`, `--settle`, `--shell`, `--tap`/`--enter`/`--press`/`--hover`/`--focus`, `--capture`/`--viewport`, `--keyboard`/`--keyboard-tint`, `--network-image`, `--platform`). |
166
+
|`semantics`| Draw the semantics tree of the same subjects into a new run, with the options of `shot` except `--keyboard-tint`. |
167
+
|`diff <a> <b>`| Compare two runs (`--images`, `--composite`). |
168
+
|`prune`| Delete every run but the newest `--keep <n>`. |
Copy file name to clipboardExpand all lines: doc/agent.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ It makes no judgement; what to shoot, how to prepare the before state, whether a
16
16
9.`diff --composite` writes one image per entry holding its before, diff and after panels, which is the one to post when you want a single attachment; `--title <text>` puts a line of your own above them, in any script. Check it before posting: it is what the reviewer sees.
17
17
10. The images are files under `.dart_tool/shutter/`; where to post them is up to you. A path alone renders nothing: `gh pr comment <number> --attach '<png>#<alt text>'` (gh 2.99+) uploads them into a GitHub comment, `glab mr note create <mr> --attach <png>` (glab 1.117+, experimental) into a GitLab one.
18
18
11. Keep the preview files: the next change is shot against the same subjects, and the Flutter Widget Previewer draws them too.
19
+
12. Runs accumulate under `.dart_tool/shutter/runs/`. `shutter prune --keep <n>` deletes every run but the newest n, the user's own included, so prune when the user asks for it, or once the images you posted no longer need their runs.
* HTTP is blocked while shooting, so an `Image.network` is an `error` shot. Fetch the image first and serve it with `--network-image <url>=<file>` (repeatable), the same in the before and after shots: `curl --create-dirs -o .dart_tool/shutter/images/avatar.png <url>`, then `shutter shot <preview-file> --network-image <url>=.dart_tool/shutter/images/avatar.png`. Only `NetworkImage` is served, not `package:http`.
45
46
*`shutter shot` shoots only the files it is given: `shutter shot lib/preview/settings_page_preview.dart`.
46
47
* Top-level functions, static methods, and constructors without required arguments are all valid targets; `MultiPreview` and `Preview` subclasses work too.
48
+
* Shots are drawn as Android, the platform `flutter test` runs as. For an app that ships on iOS, or a change to iOS-only code, pass `--platform ios` to the before and after shots alike: the theme, the back button, page transitions, adaptive widgets, and the app's own `defaultTargetPlatform` checks then draw as on an iPhone. `diff` prints `platform:` when the two runs differ in it.
*`--widget` is any Dart expression of type `Widget`; `--import` is a file under `lib/` (or a `package:` URI) it needs imported, repeatable. `package:flutter/widgets.dart` is always imported, so Material widgets need the Material library the project uses as an `--import` (`package:material_ui/material_ui.dart` or `package:flutter/material.dart`).
68
70
* Only that widget is shot, wrapped in the shell; nothing is written to the project outside `.dart_tool/shutter/`.
69
71
* The generated test is compiled inside the project, so `--import` reaches only what the project's `pubspec.yaml` already resolves: add the package first, then shoot it.
70
-
* Without `--size` the widget is shot at its own size; `--size` fixes both dimensions and stretches the widget to them.
72
+
* Without `--size` the widget is shot at its own height and its own width up to 800; `--size` fixes both dimensions and stretches the widget to them. `--size unbounded` shoots it at its own size with neither dimension bounded, so the image is exactly as large as the widget, however wide; text then wraps only at its own line breaks.
71
73
* The same `--widget` and `--import` give the same shot id in every run, so before and after line up in `diff`.
0 commit comments