previews_guest library
The guest's own plumbing — for generated code, not for projects.
The generated entrypoint is written into the user's project and imports the
package like any other consumer, so this surface has to be importable. It is
a separate library so that fact does not put host-driven machinery beside
the published API: previews.dart and ui_catalog.dart are the semver
commitments, this file follows the generators.
Nothing here is expected to be called by hand. A project writing previews
needs @Preview from Flutter and, for a shell or a knob, previews.dart.
Classes
- AxisReport
- Every axis one shell offers, as of one build of it.
- CatalogAxes
- The guest's side of the top bar: what the shell on screen declared, and the two extensions the host reads and writes them through.
- CatalogEntries
- Which entry the guest is showing, and how it is told to show another.
- CatalogGuest
- Provides the catalog's state to the entry below it, and rebuilds it when a knob moves.
- CatalogHost
- The guest's root: whichever entry the host has asked for, built the one way, under the media query a device's safe areas become.
- CatalogKeyboard
- The guest's keyboard: what the app asks for, what the host allows, and how tall the answer is.
- CatalogKeyboardScope
- FakeKeyboard, driven by CatalogKeyboard.
- CatalogKnobs
- The catalog's side of a guest: the knobs a demo declares while it builds, and the two service extensions a panel reads and writes them through.
- FakeKeyboard
- A screen with height logical pixels of keyboard across the bottom of it.
- FakeKeyboardPainter
- The slab: a suggestion strip, three letter rows, a bottom row with a space bar, and whatever band the platform leaves below it.
- GuestErrors
- Catches what the framework reports while an entry builds and paints, so that "it rendered" and "it rendered without exploding" stop being the same answer.
- GuestImages
- Answers "is this frame finished moving".
- GuestInspector
- Reads the live widget tree out of a running guest.
- GuestKeyboard
- Delivers the guest's key events, which the framework otherwise parks forever.
- GuestLogs
- Keeps what the preview printed, where it can be asked for.
- GuestTextInput
-
The guest's text input — what lets a demo's
TextFieldreceive typing. - GuestWatch
- Tells the host when what it is looking at has moved, without being asked.
- InspectConstraints
- What a parent allowed a child to be.
- InspectError
- One framework error, as the guest saw it.
- InspectErrors
- Everything one entry reported, as of the frames drawn so far.
- InspectFlex
-
A
Row,ColumnorFlex, as its children experience it. - InspectLayout
- Where a widget ended up and what it was allowed.
- InspectLogLine
- One line, with enough on it to be merged with a stream of the same lines.
- InspectLogs
- What the demo printed.
- InspectNode
- One widget in the tree.
- InspectSemantics
-
One reading of a guest's semantics tree, from
ext.flutterware.semantics. - InspectSource
- Where a widget's constructor was called.
- InspectTree
- One entry's tree, as of one build of it.
- KeyboardState
- What the guest says about its keyboard: what it was told, what the app asked for, and what is actually on screen.
- KnobDescriptor
- KnobReport
- Every knob one entry offers, as of one build of it.
- WatchBox
-
One node's box, in the guest's own coordinates — the space
InspectLayout.xreports and a capture is taken in. - WatchPush
- What the guest says when the thing you are looking at has moved.
- WatchStats
- What the watch has cost so far, read rather than pushed.
- WorldSteps
-
A world guest's steps. Each gesture on the app — a person's or an agent's,
both arrive through the binding — is one step with an id of its own,
ben.3, and what its callbacks start runs in a zone naming it. Every HTTP request the app opens carries the id inworldStepHeader, so a server whose adapter reads it can say which tap each of its events came from, and the world can join the two.
Enums
- KnobKind
- What kind of control a knob is, which is what a panel switches on.
- PickerStyle
- How a picker asks to be drawn — a knob's, or a shell's axis in the top bar.
Properties
- pinnedClockOrigin → DateTime
-
What
clock.now()reads wherever flutterware renders something twice — always this instant, never the wall clock.final
Functions
-
installInlineGuest(
{required Iterable< String> ids()}) → void -
Sets up the guest's extensions for a catalog drawn inside the host —
what the generated entrypoint's
maindoes beforerunApp, minus the parts that replace platform plumbing an embedder guest lacks and a real app has. -
installWorldInput(
[WorldSteps? steps]) → void -
Lets the world deliver to this app, each delivery a step of
stepsthe way a tap is, so what it causes joins it rather than the tap before. Asked onworldInputChannel; call once GuestTextInput.install has run. -
withPreviewClock<
T> (T body()) → T -
Runs
bodywith the preview clock pinned to pinnedClockOrigin.
Typedefs
- CatalogEntryBuilder = ({Widget Function() builder, Preview preview})
- One catalog entry, resolved by id: its annotation and how to build it.