withUpdates method
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,
);
}