copyWith method

AnnotationProperties copyWith({
  1. String? annotationId,
  2. int? pageIndex,
  3. int? strokeColor,
  4. int? fillColor,
  5. double? opacity,
  6. double? lineWidth,
  7. String? flagsJson,
  8. String? customDataJson,
  9. String? contents,
  10. String? subject,
  11. String? creator,
  12. String? bboxJson,
  13. String? note,
  14. String? inkLinesJson,
  15. String? fontName,
  16. double? fontSize,
  17. String? iconName,
})

Returns a copy with the given fields replaced.

Platform getAnnotationProperties implementations build the result from the annotation's InstantJSON, which keys the identifier as name (not annotationId) and so leaves annotationId null. They use this to stamp the authoritative annotationId / pageIndex they were queried with back onto the result, so callers (and a subsequent saveAnnotationProperties) always have the id they looked the annotation up by.

Implementation

AnnotationProperties copyWith({
  String? annotationId,
  int? pageIndex,
  int? strokeColor,
  int? fillColor,
  double? opacity,
  double? lineWidth,
  String? flagsJson,
  String? customDataJson,
  String? contents,
  String? subject,
  String? creator,
  String? bboxJson,
  String? note,
  String? inkLinesJson,
  String? fontName,
  double? fontSize,
  String? iconName,
}) =>
    AnnotationProperties(
      annotationId: annotationId ?? this.annotationId,
      pageIndex: pageIndex ?? this.pageIndex,
      strokeColor: strokeColor ?? this.strokeColor,
      fillColor: fillColor ?? this.fillColor,
      opacity: opacity ?? this.opacity,
      lineWidth: lineWidth ?? this.lineWidth,
      flagsJson: flagsJson ?? this.flagsJson,
      customDataJson: customDataJson ?? this.customDataJson,
      contents: contents ?? this.contents,
      subject: subject ?? this.subject,
      creator: creator ?? this.creator,
      bboxJson: bboxJson ?? this.bboxJson,
      note: note ?? this.note,
      inkLinesJson: inkLinesJson ?? this.inkLinesJson,
      fontName: fontName ?? this.fontName,
      fontSize: fontSize ?? this.fontSize,
      iconName: iconName ?? this.iconName,
    );