HitTestResult class

Result of hit testing at a specific position on the canvas.

Contains information about what element was hit and its properties. Used for cursor updates, interaction handling, and event routing.

Constructors

HitTestResult({String? nodeId, String? portId, String? connectionId, String? annotationId, bool? isOutput, Offset? position, HitTarget hitType = HitTarget.canvas})
const

Properties

annotationId String?
The ID of the annotation that was hit, if any.
final
connectionId String?
The ID of the connection that was hit, if any.
final
hashCode int
The hash code for this object.
no setterinherited
hitType HitTarget
The type of element that was hit.
final
isAnnotation bool
Returns true if an annotation was hit.
no setter
isCanvas bool
Returns true if empty canvas was hit (no elements).
no setter
isConnection bool
Returns true if a connection was hit.
no setter
isNode bool
Returns true if a node was hit.
no setter
isOutput bool?
Whether the hit port is an output port.
final
isPort bool
Returns true if a port was hit.
no setter
nodeId String?
The ID of the node that was hit, if any.
final
portId String?
The ID of the port that was hit, if any.
final
position Offset?
The position where the hit occurred in graph coordinates.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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