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. Offset position
    )?,
  9. void onConnectStart(
    1. String nodeId,
    2. String portId,
    3. bool isOutput
    )?,
  10. void onConnectEnd(
    1. bool success
    )?,
  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, Offset position)? onContextMenu,
  void Function(String nodeId, String portId, bool isOutput)? onConnectStart,
  void Function(bool success)? 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,
  );
}