copyWith method

CanvasRect copyWith({
  1. String? id,
  2. String? name,
  3. CanvasPaint? paint,
  4. double? rotation,
  5. bool? locked,
  6. bool? hidden,
  7. double? x,
  8. double? y,
  9. double? width,
  10. double? height,
  11. double? borderRadius,
})

Creates a copy with selected values replaced.

Implementation

CanvasRect copyWith({
  String? id,
  String? name,
  CanvasPaint? paint,
  double? rotation,
  bool? locked,
  bool? hidden,
  double? x,
  double? y,
  double? width,
  double? height,
  double? borderRadius,
}) {
  return CanvasRect(
    id: id ?? this.id,
    name: name ?? this.name,
    paint: paint ?? this.paint,
    rotation: rotation ?? this.rotation,
    locked: locked ?? this.locked,
    hidden: hidden ?? this.hidden,
    x: x ?? this.x,
    y: y ?? this.y,
    width: width ?? this.width,
    height: height ?? this.height,
    borderRadius: borderRadius ?? this.borderRadius,
  );
}