withUpdates method

AnnotationProperties withUpdates({
  1. Color? color,
  2. Color? fillColor,
  3. double? opacity,
  4. double? lineWidth,
  5. Set<AnnotationFlag>? flags,
  6. Map<String, Object?>? customData,
  7. String? contents,
  8. String? subject,
  9. String? creator,
  10. Rect? boundingBox,
  11. String? note,
})

Creates a modified copy with multiple updates.

Implementation

AnnotationProperties withUpdates({
  Color? color,
  Color? fillColor,
  double? opacity,
  double? lineWidth,
  Set<AnnotationFlag>? flags,
  Map<String, Object?>? customData,
  String? contents,
  String? subject,
  String? creator,
  Rect? boundingBox,
  String? note,
}) {
  return AnnotationProperties(
    annotationId: annotationId,
    pageIndex: pageIndex,
    strokeColor: color?.toARGB32() ?? strokeColor,
    fillColor: fillColor?.toARGB32() ?? this.fillColor,
    opacity: opacity ?? this.opacity,
    lineWidth: lineWidth ?? this.lineWidth,
    flagsJson: flags != null
        ? _encodeFlags(flags.map((f) => f.name).toList())
        : flagsJson,
    customDataJson:
        customData != null ? _encodeCustomData(customData) : customDataJson,
    contents: contents ?? this.contents,
    subject: subject ?? this.subject,
    creator: creator ?? this.creator,
    bboxJson: boundingBox != null
        ? _encodeBbox([
            boundingBox.left,
            boundingBox.top,
            boundingBox.width,
            boundingBox.height
          ])
        : bboxJson,
    note: note ?? this.note,
    inkLinesJson: inkLinesJson,
    fontName: fontName,
    fontSize: fontSize,
    iconName: iconName,
  );
}