SpatialItem class sealed
Sealed class hierarchy for spatial items in the node flow graph.
Using sealed classes provides:
- Exhaustive pattern matching (compiler enforces handling all cases)
- Type-specific fields (no nullable fields for irrelevant data)
- Clear type hierarchy
Pattern Matching Example
final result = switch (item) {
NodeSpatialItem(:final nodeId) => 'Node: $nodeId',
PortSpatialItem(:final portId, :final nodeId) => 'Port: $portId on $nodeId',
ConnectionSegmentItem(:final connectionId, :final segmentIndex) =>
'Connection: $connectionId[$segmentIndex]',
AnnotationSpatialItem(:final annotationId) => 'Annotation: $annotationId',
};
- Implemented types
- Implementers
- Available extensions
Properties
- bounds → Rect
-
The bounding rectangle of this item.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier for the spatial index.
no setteroverride
- isAnnotation → bool
-
Available on SpatialItem, provided by the SpatialItemTypeChecks extension
no setter - isConnectionSegment → bool
-
Available on SpatialItem, provided by the SpatialItemTypeChecks extension
no setter - isNode → bool
-
Available on SpatialItem, provided by the SpatialItemTypeChecks extension
no setter - isPort → bool
-
Available on SpatialItem, provided by the SpatialItemTypeChecks extension
no setter - referenceId → String
-
The ID of the actual domain object (node ID, connection ID, etc.).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWithBounds(
Rect newBounds) → SpatialItem - Creates a copy with updated bounds.
-
getBounds(
) → Rect -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited