semantic library

Module C — semantic scene. One barrel export covering the role-typed node hierarchy, classifier registry + concrete classifiers, the compactor, the semanticizer entry point, and the renderers.

Classes

AppBarClassifier
ButtonClassifier
ButtonFactsEnricher
Reads what each button and list tile would do: a tile with a tap handler becomes tappable, a button with none reads [disabled], and an icon-only button takes its tooltip as its label. Capped at maxNodes.
ClassifierRegistry
ContainerClassifier
FoldedRun
One folded run as the renderer reports it: enough for the trailer and for the eager-list check (which resolves lastItemId).
FoldRun
A run of consecutive siblings that share a structuralSignature.
IconClassifier
IconEnricher
Reads IconData.codePoint for each SemanticIcon and resolves it to a Material icon name. Capped at maxIcons to bound eval cost.
ImageClassifier
ImageEnricher
Names what each image shows (file, asset or URL from its provider) and whether it painted, in one eval. Capped at maxImages; containers that might paint a decoration image ride the same eval, capped at maxDecorationCandidates.
InertEnricher
Marks controls a person cannot use right now: faded to opacity 0 (Inert.hidden) or under an active IgnorePointer / AbsorbPointer (Inert.ignoresTouches); they lose their tap and type markers. Capped at maxNodes.
InputClassifier
InputEnricher
Reads hint (InputDecoration.labelText) and currentValue (live EditableText controller text) for each SemanticInput. Capped at maxInputs.
JsonSceneRenderer
JSON form of a scene with the same folding rule as the text renderer: a run's tail becomes one {"folded": {count, base, items}} entry.
LinkEnricher
Marks a SemanticText tappable when its RichText carries a GestureRecognizer on a span — inline links ("Sign in", Terms & Conditions, "Resend") that render as plain text but navigate on tap. Without this they show as static - and an agent can't discover them. Capped at maxTexts (one eval each); runs at full detail only.
ListClassifier
MapClassifier
A Google map: a platform view whose widget subtree says nothing; MapEnricher reads what it shows.
MapEnricher
Reads what each Google map shows: markers, routes and areas from the widget, and the live camera and marker screen points from its controller.
Reads the topmost ModalRoute's name + isFirst flag, or under a Router (go_router and other declarative routers) the router's location. Probes the innermost page first, then the outer one, so a nested route's null name does not win.
OpaqueWidgetEnricher
Reads inside widgets whose build is outside the app (a design-system package): one that takes taps becomes a button labelled by its painted text, one that only paints text becomes text. Capped at maxNodes.
OverlayEnricher
Classifies overlay dialog content from Scene.overlayRoots into SemanticScene.overlayLayers. Must run before the renderer.
PageClassifier
Material's Scaffold is the canonical page root; the compactor later hoists the SemanticPage up through ancestor containers to the tree root.
PagedViewportEnricher
Marks each page under a PageView / TabBarView with SemanticPage.onViewport, one geometry read per page, capped at maxPages.
PlainTextSceneRenderer
Compact indented form for agent prompts. Markers: * tappable, > typeable, <> scrollable, - static. Runs of foldThreshold+ siblings with the same structure render as the first item in full plus one digest line naming the rest, so a 40-row list costs a few lines, not a few hundred.
RenderResult
A rendered scene plus what the renderer left out, so a caller can write an honest trailer without re-parsing the text.
RouteFrame
SceneCompactor
Strips framework noise: expandChild spills nameless pass-throughs into the parent's child list; hoistPage surfaces a SemanticPage past app-shell wrappers.
SceneRenderer
SegmentedClassifier
A segmented control: Flutter builds each segment's button itself, so only the app's segment labels reach the scene; each label becomes the button to tap.
SemanticAppBar
SemanticButton
SemanticContainer
Anything that groups other nodes without a more specific role — rows, columns, padding, etc. that survived the compaction pass.
SemanticEnricher
Post-classify pass that fills role-specific properties (hint, currentValue, icon name, route info, …) by talking to the live runtime — data pure SceneNode parsing can't surface.
SemanticIcon
SemanticImage
SemanticInput
Semanticizer
Module C entry — bottom-up classify + compact + hoist page to root.
SemanticList
SemanticMap
Floor classifier output — a node we know about but can't classify. Keeps label for debugging and glintId so the agent can still target it. A Google map: its camera and what it draws, filled by MapEnricher from the widget and its controller.
SemanticMapItem
One thing a map draws: a marker, a route (polyline) or an area (polygon or circle).
SemanticNode
SemanticOverlayLayer
One overlay layer (dialog, bottom sheet, or other modal entry) sitting above the base screen. isBarriered is true when a ModalBarrier sits between this layer and what is below it — the layer below is painted but not hittable.
SemanticPage
Top of the tree: a screen / route. Holds the optional appBar and a flat body; not tappable itself.
SemanticScene
Module C output. The Interactor still uses sourceScene for the raw hit-test geometry, so callers own its dispose().
SemanticsFlagEnricher
Reads selection and checked state for buttons from the widget (selected on chips), its nearest Semantics wrapper or a Semantics inside it, in one eval. Capped at maxNodes.
SemanticText
SemanticUnknown
TabBarClassifier
A navigation bar: its destinations' labels are strings, so only their icons reach the scene; each item becomes a tab button that TabLabelEnricher names.
TabLabelEnricher
Names the tabs of each navigation bar and marks the selected one, from the bar's destinations or items, whose labels are plain strings the scene never sees.
TextClassifier
ToggleClassifier
Checkbox / Switch / Radio and their ListTile forms — tappable one-liners; a ListTile's inner toggle widget is absorbed, the tile is the tap target.
ToggleEnricher
Reads the live value of Checkbox / Switch-shaped toggles into SemanticButton.toggleState ('on'/'off'). Radio is excluded — its value is the option, not the checked state. Capped at maxToggles.
UnknownClassifier
Floor — matches everything; keeps the original widget label.
WidgetClassifier
One widget-recognition rule. Lower priority runs first, first match wins; UnknownClassifier is the floor.

Enums

Affordance
Inert
Why a control on screen cannot be used right now.
SemanticRole

Constants

kPagedLabels → const Set<String>
Source labels whose children are pages laid side by side: every page stays in the tree, so which one is on screen is a geometry fact.
obscuredValuePrefix → const String
Marks an obscured field's value as <prefix><length>; plain text never starts with it.

Functions

batchOverElements(List<String> ids, String f) → String
detectFoldRun(List<SemanticNode> children, int start, {int threshold = 4}) → FoldRun?
The run starting at start when at least threshold consecutive siblings share a signature; null otherwise.
foldDigest(List<SemanticNode> items, String? runBase, {int max = 10}) → String
The digest entries for the folded tail of a run (everything after the first item): "label" #hash pairs, at most max, then +N.
foldItemLabel(SemanticNode item, {int maxChars = 60}) → String?
What a folded item is called in the digest: all its texts joined with ·, cut at maxChars. Null when it says nothing.
foldItemRef(SemanticNode item, String? runBase) → String?
The short address shown in a digest: #hash when the item shares the run's base, otherwise the full id.
glintIdBase(String id) → String
base#hash → base; unchanged when there is no hash.
groupFor(Scene scene, SceneNode source) → String
Evaluates one expression over many elements at once: f is a block-bodied lambda taking an Element and returning a String; results come back ;-joined in ids order. The inspector group that owns source's id: overlay nodes come from the full-tree read, whose ids the summary group cannot look up.
imageSourceName(String provider) → String?
Short name for an ImageProvider's toString(): a file's base name, an asset name, a URL's host and last segment, else the provider type.
structuralSignature(SemanticNode node) → String
Structural fingerprint of a subtree: what a node IS, not what it says. Two list rows with different text but the same shape share a signature; a row whose toggle state differs, or that lacks a button, does not.