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 three questions that are bugs when the answer is not empty: which components nothing on the surface reaches (unreachable), whether a component contains itself (cyclic), and which child references name a component the surface does not have (dangling).

The children of a component are the ones its catalog's schema marks as children, which a2ui_core reads the same way when it renders the surface. A component whose type its catalog does not hold has no schema to read, so for it a string property counts as a child when it matches the id of a component on the same surface, and a reference it makes to a missing component cannot be told from text.

Constructors

GenUiSurfaceGraph.of(SurfaceModel<ComponentApi> surface)
Reads the graph out of surface.
factory

Properties

cyclic → Set<String>
Components that contain themselves, directly or through a descendant.
final
dangling → Map<String, Set<String>>
The child references that name a component the surface does not have, by the id of the component making them.
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
surface → SurfaceModel<ComponentApi>
The surface this graph was read from.
final
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