updateDefaultAnnotationStyle method
Sets the default annotation style for the CPDFReaderWidget. This method allows you to customize the default attributes for annotations such as color, alpha, and border width. example:
CPDFAnnotAttribute defaultStyle = await controller.fetchDefaultAnnotationStyle();
// For example, to set the default style for a note annotation:
CPDFNoteAttr noteAttr = defaultStyle.noteAttr.copyWith(
color: Colors.red,
alpha: 128,
);
await controller.updateDefaultAnnotationStyle(noteAttr);
// To set the default style for an ink annotation:
CPDFInkAttr inkAttr = defaultStyle.inkAttr.copyWith(
color: Colors.blue,
alpha: 200,
borderWidth: 5);
await controller.updateDefaultAnnotationStyle(inkAttr);
Implementation
Future<void> updateDefaultAnnotationStyle(
CPDFAnnotAttrBase annotationStyle) async {
return await _channel.invokeMethod('set_default_annotation_attr',
{'type': annotationStyle.type, 'attr': annotationStyle.toJson()});
}