setFlagsForAnnotations static method
Sets flags for the specified annotations in the current document.
List<AnnotWithFlags> annotsWithFlags = new List<AnnotWithFlags>.empty(growable: true);
Annot hello = new Annot('Hello', 1);
Annot world = new Annot('World', 3);
AnnotFlag printOn = new AnnotFlag(AnnotationFlags.print, true);
AnnotFlag unlock = new AnnotFlag(AnnotationFlags.locked, false);
// You can add an AnnotWithFlags object flexibly like this:
annotWithFlags.add(new AnnotWithFlags.fromAnnotAndFlags(hello, [printOn, unlock]));
annotWithFlags.add(new AnnotWithFlags.fromAnnotAndFlags(world, [unlock]));
// Or simply use the constructor like this:
annotsWithFlags.add(new AnnotWithFlags('Pdftron', 10, AnnotationFlags.noZoom, true));
await PdftronFlutter.setFlagsForAnnotations(annotsWithFlags);
Implementation
static Future<void> setFlagsForAnnotations(
List<AnnotWithFlag> annotationWithFlagsList) {
return _channel.invokeMethod(
Functions.setFlagsForAnnotations, <String, dynamic>{
Parameters.annotationsWithFlags: jsonEncode(annotationWithFlagsList)
});
}