addAnnotationReply method
Future<CPDFReplyAnnotation?>
addAnnotationReply(
- CPDFAnnotation annotation, {
- required String content,
- String title = '',
Adds a plain reply to an annotation.
Parameters:
annotation - The parent annotation to reply to.
content - The reply content.
title - The reply author or title.
Returns: The created reply annotation, or null if creation fails.
Example:
final annotations = await document.pageAtIndex(0).getAnnotations();
if (annotations.isNotEmpty) {
final reply = await document.addAnnotationReply(
annotations.first,
content: 'Please review this highlight.',
title: 'ComPDFKit',
);
debugPrint('Reply id: ${reply?.uuid}');
}
Since v2.6.8
Implementation
Future<CPDFReplyAnnotation?> addAnnotationReply(
CPDFAnnotation annotation, {
required String content,
String title = '',
}) async {
final result = await _channel.invokeMethod('add_annotation_reply', {
'page_index': annotation.page,
'uuid': annotation.uuid,
'content': content,
'title': title,
});
if (result is Map) {
return _replyFromJson(Map<String, dynamic>.from(result));
}
return null;
}