copy method

EdgeConnectionsModel<E> copy({
  1. NodeSocketModel? source,
  2. NodeSocketModel? target,
  3. E? data,
  4. LukeEdgePainter? painter,
  5. double? animationSpeed,
  6. bool? isAnimated,
})

Returns a new copy with updated source and/or target sockets.

Implementation

EdgeConnectionsModel<E> copy({
  NodeSocketModel? source,
  NodeSocketModel? target,
  E? data,
  LukeEdgePainter? painter,
  double? animationSpeed,
  bool? isAnimated,
}) {
  final newSource = source ?? this.source.copy();
  final newTarget = target ?? this.target.copy();
  return EdgeConnectionsModel<E>(
    source: newSource,
    target: newTarget,
    data: data ?? this.data,
    painter: painter ?? this.painter,
    animationSpeed: animationSpeed ?? this.animationSpeed,
    isAnimated: isAnimated ?? this.isAnimated,
  );
}