copyWith method
Creates a copy of this group annotation with optional property overrides.
This is useful for creating variations of an existing group or for implementing undo/redo functionality.
Implementation
GroupAnnotation copyWith({
String? id,
Offset? position,
Size? size,
String? title,
Color? color,
GroupBehavior? behavior,
Set<String>? nodeIds,
EdgeInsets? padding,
int? zIndex,
bool? isVisible,
bool? isInteractive,
Map<String, dynamic>? metadata,
}) {
return GroupAnnotation(
id: id ?? this.id,
position: position ?? this.position,
size: size ?? this.size,
title: title ?? currentTitle,
color: color ?? currentColor,
behavior: behavior ?? this.behavior,
nodeIds: nodeIds ?? Set.from(_nodeIds),
padding: padding ?? this.padding,
zIndex: zIndex ?? this.zIndex,
isVisible: isVisible ?? this.isVisible,
isInteractive: isInteractive ?? this.isInteractive,
metadata: metadata ?? this.metadata,
);
}