copyWith method
DrawingTool
copyWith({
- String? id,
- Color? color,
- double? strokeWidth,
- bool? isVisible,
- DrawingToolState? state,
Implementation
DrawingTool copyWith({
String? id,
Color? color,
double? strokeWidth,
bool? isVisible,
DrawingToolState? state,
}) {
final updated = HorizontalRayTool(
id: id ?? this.id,
yPosition: yPosition,
centerX: centerX,
priceValue: priceValue,
color: color ?? this.color,
strokeWidth: strokeWidth ?? this.strokeWidth,
);
updated.isVisible = isVisible ?? this.isVisible;
updated.state = state ?? this.state;
return updated;
}