placed method

UDocShape placed({
  1. int? pageIndex,
  2. int? blockIndex,
  3. int? startMs,
  4. int? endMs,
  5. bool clearTime = false,
  6. bool copy = false,
})

Stamps where the shape lives; copy gives it a fresh id.

Implementation

UDocShape placed({int? pageIndex, int? blockIndex, int? startMs, int? endMs, bool clearTime = false, bool copy = false}) {
  final DateTime now = DateTime.now();
  return UDocShape(
    id: copy ? _shapeId() : id,
    kind: kind,
    points: points,
    pageIndex: pageIndex ?? this.pageIndex,
    blockIndex: blockIndex ?? this.blockIndex,
    strokeColor: strokeColor,
    fillColor: fillColor,
    strokeWidth: strokeWidth,
    opacity: opacity,
    dashed: dashed,
    text: text,
    fontSize: fontSize,
    bold: bold,
    startMs: clearTime ? null : (startMs ?? this.startMs),
    endMs: clearTime ? null : (endMs ?? this.endMs),
    createdAt: copy ? now : createdAt,
    updatedAt: now,
  );
}