copyWith method

ConnectionEvents<T> copyWith({
  1. ValueChanged<Connection>? onCreated,
  2. ValueChanged<Connection>? onDeleted,
  3. ValueChanged<Connection?>? onSelected,
  4. ValueChanged<Connection>? onTap,
  5. ValueChanged<Connection>? onDoubleTap,
  6. ValueChanged<Connection>? onMouseEnter,
  7. ValueChanged<Connection>? onMouseLeave,
  8. void onContextMenu(
    1. Connection connection,
    2. ScreenPosition screenPosition
    )?,
  9. void onConnectStart(
    1. Node<T> sourceNode,
    2. Port sourcePort
    )?,
  10. void onConnectEnd(
    1. Node<T>? targetNode,
    2. Port? targetPort
    )?,
  11. ConnectionValidationResult onBeforeStart(
    1. ConnectionStartContext<T> context
    )?,
  12. ConnectionValidationResult onBeforeComplete(
    1. ConnectionCompleteContext<T> context
    )?,
})

Implementation

ConnectionEvents<T> copyWith({
  ValueChanged<Connection>? onCreated,
  ValueChanged<Connection>? onDeleted,
  ValueChanged<Connection?>? onSelected,
  ValueChanged<Connection>? onTap,
  ValueChanged<Connection>? onDoubleTap,
  ValueChanged<Connection>? onMouseEnter,
  ValueChanged<Connection>? onMouseLeave,
  void Function(Connection connection, ScreenPosition screenPosition)?
  onContextMenu,
  void Function(Node<T> sourceNode, Port sourcePort)? onConnectStart,
  void Function(Node<T>? targetNode, Port? targetPort)? onConnectEnd,
  ConnectionValidationResult Function(ConnectionStartContext<T> context)?
  onBeforeStart,
  ConnectionValidationResult Function(ConnectionCompleteContext<T> context)?
  onBeforeComplete,
}) {
  return ConnectionEvents<T>(
    onCreated: onCreated ?? this.onCreated,
    onDeleted: onDeleted ?? this.onDeleted,
    onSelected: onSelected ?? this.onSelected,
    onTap: onTap ?? this.onTap,
    onDoubleTap: onDoubleTap ?? this.onDoubleTap,
    onMouseEnter: onMouseEnter ?? this.onMouseEnter,
    onMouseLeave: onMouseLeave ?? this.onMouseLeave,
    onContextMenu: onContextMenu ?? this.onContextMenu,
    onConnectStart: onConnectStart ?? this.onConnectStart,
    onConnectEnd: onConnectEnd ?? this.onConnectEnd,
    onBeforeStart: onBeforeStart ?? this.onBeforeStart,
    onBeforeComplete: onBeforeComplete ?? this.onBeforeComplete,
  );
}