preloadPages method

Future<void> preloadPages({
  1. dynamic onZoomChanged(
    1. double
    )?,
  2. int? zoomSteps,
  3. double? minScale,
  4. double? maxScale,
  5. double? panLimit,
})

Implementation

Future<void> preloadPages({
  final Function(double)? onZoomChanged,
  final int? zoomSteps,
  final double? minScale,
  final double? maxScale,
  final double? panLimit,
}) async {
  int countvar = 1;
  for (final _ in List.filled(count, null)) {
    final data = await _channel.invokeMethod(
        'getPage', {'filePath': _filePath, 'pageNumber': countvar});
    _pages.add(PDFPage(
      data as String?,
      countvar,
      onZoomChanged: onZoomChanged,
      zoomSteps: zoomSteps ?? 3,
      minScale: minScale ?? 1.0,
      maxScale: maxScale ?? 5.0,
      panLimit: panLimit ?? 1.0,
    ));
    countvar++;
  }
  _preloaded = true;
}