isSelfConnection property
bool
get
isSelfConnection
Whether this is a self-connection (connecting a node to itself).
Many applications disallow self-connections to prevent cycles, but some may allow them for specific use cases.
Implementation
bool get isSelfConnection => sourceNode.id == targetNode.id;