copyWith method
Creates a copy of this group node with optional property overrides.
This is useful for creating variations of an existing group or for implementing undo/redo functionality.
Implementation
GroupNode<T> copyWith({
String? id,
Offset? position,
Size? size,
String? title,
T? data,
Color? color,
GroupBehavior? behavior,
Set<String>? nodeIds,
EdgeInsets? padding,
int? zIndex,
bool? isVisible,
bool? locked,
List<Port>? inputPorts,
List<Port>? outputPorts,
}) {
return GroupNode<T>(
id: id ?? this.id,
position: position ?? this.position.value,
size: size ?? this.size.value,
title: title ?? currentTitle,
data: data ?? this.data,
color: color ?? currentColor,
behavior: behavior ?? this.behavior,
nodeIds: nodeIds ?? Set.from(_nodeIds),
padding: padding ?? this.padding,
zIndex: zIndex ?? this.zIndex.value,
isVisible: isVisible ?? this.isVisible,
locked: locked ?? this.locked,
inputPorts: inputPorts ?? List.from(this.inputPorts),
outputPorts: outputPorts ?? List.from(this.outputPorts),
);
}