copyWith method

CanvasTextObject copyWith({
  1. String? id,
  2. String? name,
  3. CanvasPaint? paint,
  4. double? rotation,
  5. bool? locked,
  6. bool? hidden,
  7. String? text,
  8. double? x,
  9. double? y,
})

Creates a copy with selected values replaced.

Implementation

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