GenUiSurfaceGraph class

The shape of a surface the model built: what contains what, and which data model paths each component is bound to.

Nothing in an app's source says that /cart/total is on screen, or that item_row sits inside cart_list. A model decided both at runtime, in a message that is gone by the time someone reports the bug. This reads that decision back out of the component definitions.

It also answers two questions that are bugs when the answer is not empty: which components nothing on the surface reaches (unreachable), and whether a component contains itself (cyclic).

One caveat on childrenOf. A2UI names a child by its id, as a plain string, and the string carries nothing that marks it as an id rather than as text. The catalog's schema is what tells them apart, and in practice it does so by the description on the property, which every catalog is free to write its own way. So this reads a string property as a child when it matches the id of a component on the same surface, which has two consequences worth knowing. A literal that happens to equal an id is drawn as an edge. And a child reference naming a component that was never created is not drawn at all, because nothing distinguishes it from text; it shows up as the hole it leaves on screen, not here.

Constructors

GenUiSurfaceGraph.of(SurfaceDefinition definition)
Reads the graph out of definition.
factory

Properties

cyclic → Set<String>
Components that contain themselves, directly or through a descendant.
final
definition → SurfaceDefinition
The surface this graph was read from.
final
hashCode → int
The hash code for this object.
no setterinherited
hasRoot → bool
Whether the surface has the component the renderer starts from.
no setter
order → List<String>
Every component reachable from genUiRootComponentId, in the order a depth-first walk of the tree visits them.
final
pathBindings → Map<String, Set<String>>
Every bound path on the surface, and the components bound to it.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unreachable → Set<String>
Components the surface defines that nothing reaches from the root.
final

Methods

childrenOf(String id) → Set<String>
The children of id, in the order its properties name them.
depthOf(String id) → int?
How deep id sits under the root, or null when nothing reaches it.
describe() → String
What is worth knowing about the surface, in a line or three.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pathsOf(String id) → Set<String>
The data model paths id is bound to, resolved.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited