ConnectionEvents<T, C> class

Events related to connection interactions.

Type parameters:

  • T: The type of node data (for node context in callbacks)
  • C: The type of connection data

Constructors

ConnectionEvents({ValueChanged<Connection<C>>? onCreated, BeforeDeleteCallback<Connection<C>>? onBeforeDelete, ValueChanged<Connection<C>>? onDeleted, ValueChanged<Connection<C>?>? onSelected, ValueChanged<Connection<C>>? onTap, ValueChanged<Connection<C>>? onDoubleTap, ValueChanged<Connection<C>>? onMouseEnter, ValueChanged<Connection<C>>? onMouseLeave, void onContextMenu(Connection<C> connection, ScreenPosition screenPosition)?, void onConnectStart(Node<T> sourceNode, Port sourcePort)?, void onConnectEnd(Node<T>? targetNode, Port? targetPort, GraphPosition position)?, ConnectionValidationResult onBeforeStart(ConnectionStartContext<T> context)?, ConnectionValidationResult onBeforeComplete(ConnectionCompleteContext<T> context)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onBeforeComplete ConnectionValidationResult Function(ConnectionCompleteContext<T> context)?
Validation callback before completing a connection to a target port Return ConnectionValidationResult with allowed: false to prevent connection
final
onBeforeDelete BeforeDeleteCallback<Connection<C>>?
Called before a connection is deleted to allow cancellation.
final
onBeforeStart ConnectionValidationResult Function(ConnectionStartContext<T> context)?
Validation callback before starting a connection from a port Return ConnectionValidationResult with allowed: false to prevent connection start
final
onConnectEnd → void Function(Node<T>? targetNode, Port? targetPort, GraphPosition position)?
Called when connection creation ends.
final
onConnectStart → void Function(Node<T> sourceNode, Port sourcePort)?
Called when starting to create a connection from a port.
final
onContextMenu → void Function(Connection<C> connection, ScreenPosition screenPosition)?
Called on secondary tap on a connection (right-click/long-press for context menu).
final
onCreated ValueChanged<Connection<C>>?
Called when a connection is created
final
onDeleted ValueChanged<Connection<C>>?
Called when a connection is deleted
final
onDoubleTap ValueChanged<Connection<C>>?
Called when a connection is double-tapped
final
onMouseEnter ValueChanged<Connection<C>>?
Called when mouse enters a connection's path
final
onMouseLeave ValueChanged<Connection<C>>?
Called when mouse leaves a connection's path
final
onSelected ValueChanged<Connection<C>?>?
Called when a connection's selection state changes Receives the selected connection, or null if selection was cleared
final
onTap ValueChanged<Connection<C>>?
Called when a connection is tapped
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ValueChanged<Connection<C>>? onCreated, BeforeDeleteCallback<Connection<C>>? onBeforeDelete, ValueChanged<Connection<C>>? onDeleted, ValueChanged<Connection<C>?>? onSelected, ValueChanged<Connection<C>>? onTap, ValueChanged<Connection<C>>? onDoubleTap, ValueChanged<Connection<C>>? onMouseEnter, ValueChanged<Connection<C>>? onMouseLeave, void onContextMenu(Connection<C> connection, ScreenPosition screenPosition)?, void onConnectStart(Node<T> sourceNode, Port sourcePort)?, void onConnectEnd(Node<T>? targetNode, Port? targetPort, GraphPosition position)?, ConnectionValidationResult onBeforeStart(ConnectionStartContext<T> context)?, ConnectionValidationResult onBeforeComplete(ConnectionCompleteContext<T> context)?}) ConnectionEvents<T, C>
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