Skip to main content

contact_sheet 0.1.0 copy "contact_sheet: ^0.1.0" to clipboard
contact_sheet: ^0.1.0 copied to clipboard

Every page of a Flutter app as one map, from its widget previews shot with shutter, written as HTML and JSON, and SVG when asked.

Contact Sheet #

Every page of a Flutter app as one map: each state of each page as an image, each transition as an arrow. The map is HTML and JSON (and SVG, when asked), opened without any tool, for everyone who works on the app, whether in its code or not: product managers, designers, marketing, support.

The map of the shop example: its pages, each as its preview, the transitions between them, and each page's design linked above it

See it: the maps of the example apps, exported from the examples in the repository.

How it works #

Code, specifications and the like, looked into by an AI agent, become the sheet; sheet export shoots the previews and draws the map

  1. An AI agent finds out the screen transitions that actually happen in the app, from whatever tells how the app works (its code, its specifications), and writes them as the app's sheet (contact_sheet/sheet.yaml), naming a @Preview for each state of each page.
  2. sheet export shoots those previews with shutter, drawn as iOS (or Android, where the sheet asks for it), and draws the map.

The previews are the app's own where it has them (a team on shutter or the Widget Previewer has one per page). For the pages and states the app has none of, the agent writes them in the sheet package, a small Flutter package in contact_sheet/ that imports the app. The app's code is never changed. Contact Sheet draws the sheet as it is: it does not check it against the app.

What the map shows #

  • Every page, grouped by section, with the transitions between pages and the deep links into them. The map shows each page in its first state; a page chosen, and the list, show all its states (as a guest or signed in, empty, loading).
  • Choose a page to see its memo, its tags, its states, and each of its transitions as a sentence ("When Guest, tap “Log in” → Log in (From home)"). Tap an arrow to read it as a sentence.
  • Tags: links from each page to the team's other tools (its analytics, its design, its spec, its address on the web, made from its path), shown beside the page and above it on the map. A state has its own values where they differ from its page's.
  • How much the map shows: the pages only, the pages and arrows, or the arrows with their labels; the arrows back hidden at first, or shown; and which tags, and whether the memo, are shown on the pages (only the arrows and the analytics, say).
  • The tree: the pages top to bottom, like a site map, each under the page from which the app's start first reaches it.
  • What a user sees while some things stay fixed: choose values for what the app keeps across its pages (signed in or not, the cart), and only the pages and transitions the app shows then remain, the rest hidden in place. A guest who never signs in, say.
  • The route between two pages: the fewest steps, as the app's navigator takes them, following redirects, what the app keeps across its pages (signed in, the cart) and tabs that keep their own histories.
  • A list of the pages, a table of the transitions, search, and an address to pass around for each page, state and route.
  • Variants, where the sheet names them: iOS or Android, phone or tablet.
  • What only developers read (the code's names and files) is behind “For developers”.
  • Where it came from: the app's version and branch, when it was exported, and how many of the app's changes since the sheet was written are on no page of the sheet (a sign the sheet may need bringing up to date).
  • Light and dark, a phone's width, and print.

The cart of the shop example chosen: its states, and its transitions as sentences

The tree of the trips example, 37 pages: each page under the page the app's start first reaches it from

contact_sheet/map/ holds:

  • index.html, with the images in images/ next to it (or the folder --images names): opened from disk or served anywhere.
  • sheet.json: what it is drawn from, for other tools and AI agents.
  • With export --svg, map.svg: the whole map as one picture, images included, to be passed around alone; map-dev.svg, with what developers read too.

Requirements #

  • Flutter 3.47 or later (Dart 3.13 or later), as shutter needs.
  • flutter_test in the app's dev_dependencies where the sheet names the app's own previews, as shutter shoots them in flutter test (the sheet package has it).
  • An AI agent to write the sheet: any that runs commands, such as Claude Code or Codex.

shutter comes with the command: nothing else to install.

Getting started #

  1. Install the command, sheet (dart install compiles it to a native binary on the PATH):

    dart install contact_sheet
    
  2. In the app's directory, ask the AI agent:

    Run `sheet agent` and follow it.
    

    The agent reads the app, writes its sheet (contact_sheet/sheet.yaml), writes the previews the app does not have in the sheet package (contact_sheet/), and runs sheet export. The app's own code is not changed.

  3. Open contact_sheet/map/index.html.

Commands #

Command What
sheet agent Prints the playbook the AI agent follows to write the sheet
sheet manual Prints the reference: the sheet's fields, the map, the exit codes
sheet init Writes an empty sheet; with --package, the sheet package's skeleton too
sheet export Shoots the previews the sheet names and writes the map into contact_sheet/map/
sheet lint Tells what the sheet may be missing or have written twice
sheet basis Records the app as it is now as what the sheet was written against
sheet changed Lists the app's files changed since then: the sheet may need bringing up to date for them
sheet prune Deletes shutter's runs that Contact Sheet left

sheet help <command> tells a command's options. An export deletes the runs of shutter's it made, so the team's own runs in the app stay as they were.

In the app's repository #

Contact Sheet adds contact_sheet/ to the app, and, where it needs one, a line to its .gitignore:

  • sheet.yaml and basis.json, and the sheet package where there is one: kept in git.
  • map/: the map (about 0.38 MB for the shop example's 11 states, its images WebP drawn at a pixel ratio of 1.5). Commit it, or ignore it and export it where it is shared (export --out <folder>), or have CI export it. Its images depend on the machine's fonts (Cupertino text is SF Pro on macOS, Roboto elsewhere): export it on one kind of machine, macOS to look as an iPhone does.
  • .dart_tool/: what an export keeps between runs, and the sheet package's shots: out of git. Flutter's .gitignore ignores .dart_tool/ at any depth; where the app's .gitignore does not, init adds contact_sheet/.dart_tool/ to it.

More #

  • The manual: the sheet's fields, the map, sheet.json, the commands' options and exit codes.
  • The playbook: what the AI agent follows.
  • The examples: four apps and their sheets (go_router, Navigator 1.0, bottom tabs, and a travel app of 37 pages with tabs that keep their own histories), their previews from different places.
  • The changelog.
  • Problems and ideas: the issues.
  • Working on Contact Sheet itself: doc/development.md.

License #

MIT (LICENSE).

0
likes
160
points
185
downloads
screenshot

Documentation

API reference

Publisher

verified publisherkoji-1009.com

Weekly Downloads

Every page of a Flutter app as one map, from its widget previews shot with shutter, written as HTML and JSON, and SVG when asked.

Repository (GitHub)
View/report issues

Topics

#flutter #preview #navigation #documentation #cli

License

MIT (license)

Dependencies

args, crypto, image, io, path, shutter, stack_trace, yaml

More

Packages that depend on contact_sheet