copyWith method

UDocShape copyWith({
  1. List<Offset>? points,
  2. Color? strokeColor,
  3. Color? fillColor,
  4. bool clearFill = false,
  5. double? strokeWidth,
  6. double? opacity,
  7. bool? dashed,
  8. String? text,
  9. double? fontSize,
  10. bool? bold,
  11. int? startMs,
  12. int? endMs,
  13. UDocShapeKind? kind,
})

Implementation

UDocShape copyWith({
  List<Offset>? points,
  Color? strokeColor,
  Color? fillColor,
  bool clearFill = false,
  double? strokeWidth,
  double? opacity,
  bool? dashed,
  String? text,
  double? fontSize,
  bool? bold,
  int? startMs,
  int? endMs,
  UDocShapeKind? kind,
}) => UDocShape(
  id: id,
  kind: kind ?? this.kind,
  points: points ?? this.points,
  pageIndex: pageIndex,
  blockIndex: blockIndex,
  strokeColor: strokeColor ?? this.strokeColor,
  fillColor: clearFill ? null : (fillColor ?? this.fillColor),
  strokeWidth: strokeWidth ?? this.strokeWidth,
  opacity: opacity ?? this.opacity,
  dashed: dashed ?? this.dashed,
  text: text ?? this.text,
  fontSize: fontSize ?? this.fontSize,
  bold: bold ?? this.bold,
  startMs: startMs ?? this.startMs,
  endMs: endMs ?? this.endMs,
  createdAt: createdAt,
  updatedAt: DateTime.now(),
);