copyWith method

PdfViewerParams copyWith({
  1. int? pageNumber,
  2. double? padding,
  3. LayoutPagesFunc? layoutPages,
  4. BuildPageContentFunc? buildPagePlaceholder,
  5. BuildPageContentFunc? buildPageOverlay,
  6. BoxDecoration? pageDecoration,
  7. Axis? scrollDirection,
  8. PanAxis? panAxis,
  9. @Deprecated('Use panAxis instead. ' 'This feature was deprecated after flutter sdk v3.3.0-0.5.pre.') bool? alignPanAxis,
  10. EdgeInsets? boundaryMargin,
  11. bool? panEnabled,
  12. bool? scaleEnabled,
  13. double? maxScale,
  14. double? minScale,
  15. GestureScaleEndCallback? onInteractionEnd,
  16. GestureScaleStartCallback? onInteractionStart,
  17. GestureScaleUpdateCallback? onInteractionUpdate,
  18. OnPdfViewerControllerInitialized? onViewerControllerInitialized,
  19. double? scrollByMouseWheel,
  20. OnClickOutsidePageViewer? onClickOutSidePageViewer,
})

Implementation

PdfViewerParams copyWith({
  int? pageNumber,
  double? padding,
  LayoutPagesFunc? layoutPages,
  BuildPageContentFunc? buildPagePlaceholder,
  BuildPageContentFunc? buildPageOverlay,
  BoxDecoration? pageDecoration,
  Axis? scrollDirection,
  PanAxis? panAxis,
  @Deprecated(
    'Use panAxis instead. '
    'This feature was deprecated after flutter sdk v3.3.0-0.5.pre.',
  )
  bool? alignPanAxis,
  EdgeInsets? boundaryMargin,
  bool? panEnabled,
  bool? scaleEnabled,
  double? maxScale,
  double? minScale,
  GestureScaleEndCallback? onInteractionEnd,
  GestureScaleStartCallback? onInteractionStart,
  GestureScaleUpdateCallback? onInteractionUpdate,
  OnPdfViewerControllerInitialized? onViewerControllerInitialized,
  double? scrollByMouseWheel,
  OnClickOutsidePageViewer? onClickOutSidePageViewer,
}) {
  final resolvedPanAxis = panAxis ??
      (alignPanAxis == null
          ? this.panAxis
          : (alignPanAxis ? PanAxis.aligned : this.panAxis));

  return PdfViewerParams(
    pageNumber: pageNumber ?? this.pageNumber,
    padding: padding ?? this.padding,
    layoutPages: layoutPages ?? this.layoutPages,
    buildPagePlaceholder: buildPagePlaceholder ?? this.buildPagePlaceholder,
    buildPageOverlay: buildPageOverlay ?? this.buildPageOverlay,
    pageDecoration: pageDecoration ?? this.pageDecoration,
    scrollDirection: scrollDirection ?? this.scrollDirection,
    panAxis: resolvedPanAxis,
    boundaryMargin: boundaryMargin ?? this.boundaryMargin,
    panEnabled: panEnabled ?? this.panEnabled,
    scaleEnabled: scaleEnabled ?? this.scaleEnabled,
    maxScale: maxScale ?? this.maxScale,
    minScale: minScale ?? this.minScale,
    onInteractionEnd: onInteractionEnd ?? this.onInteractionEnd,
    onInteractionStart: onInteractionStart ?? this.onInteractionStart,
    onInteractionUpdate: onInteractionUpdate ?? this.onInteractionUpdate,
    onViewerControllerInitialized:
        onViewerControllerInitialized ?? this.onViewerControllerInitialized,
    scrollByMouseWheel: scrollByMouseWheel ?? this.scrollByMouseWheel,
    onClickOutSidePageViewer:
        onClickOutSidePageViewer ?? this.onClickOutSidePageViewer,
  );
}