getAnnotationsOnPage method

Future<List<Annot>?> getAnnotationsOnPage(
  1. int pageNumber
)

Gets the list of annotations on the given page.

Implementation

Future<List<Annot>?> getAnnotationsOnPage(int pageNumber) {
  return _channel.invokeMethod(Functions.getAnnotationsOnPage, <String, dynamic>{
    Parameters.pageNumber: pageNumber
  }).then((jsonArray) {
    List<dynamic> annotations = jsonDecode(jsonArray);
    List<Annot> annotList = new List<Annot>.empty(growable: true);
    for (dynamic annotation in annotations) {
      annotList.add(new Annot.fromJson(annotation));
    }
    return annotList;
  });
}