copyWith method

FlowCanvasModel<T> copyWith({
  1. List<NodeModel<T>>? nodes,
  2. List<EdgeConnectionsModel>? connections,
})

Implementation

FlowCanvasModel<T> copyWith({
  List<NodeModel<T>>? nodes,
  List<EdgeConnectionsModel>? connections,
}) {
  return FlowCanvasModel<T>(
    nodes: nodes ?? this.nodes.map((n) => n.copy()).toList(),
    connections:
        connections ?? this.connections.map((c) => c.copy()).toList(),
  );
}