copyWith method

CanvasLine copyWith({
  1. String? id,
  2. String? name,
  3. CanvasPaint? paint,
  4. double? rotation,
  5. bool? locked,
  6. bool? hidden,
  7. double? x1,
  8. double? y1,
  9. double? x2,
  10. double? y2,
})

Creates a copy with selected values replaced.

Implementation

CanvasLine copyWith({
  String? id,
  String? name,
  CanvasPaint? paint,
  double? rotation,
  bool? locked,
  bool? hidden,
  double? x1,
  double? y1,
  double? x2,
  double? y2,
}) {
  return CanvasLine(
    id: id ?? this.id,
    name: name ?? this.name,
    paint: paint ?? this.paint,
    rotation: rotation ?? this.rotation,
    locked: locked ?? this.locked,
    hidden: hidden ?? this.hidden,
    x1: x1 ?? this.x1,
    y1: y1 ?? this.y1,
    x2: x2 ?? this.x2,
    y2: y2 ?? this.y2,
  );
}