copyWith method

DrawingTool copyWith({
  1. String? id,
  2. Color? color,
  3. double? strokeWidth,
  4. bool? isVisible,
  5. 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;
}