PdfViewerParams class
Viewer customization parameters.
Changes to several builder functions such as layoutPages does not take effect until the viewer is re-layout-ed. You can relayout the viewer by calling PdfViewerController.relayout.
- Annotations
Constructors
-
PdfViewerParams({double margin = 8.0, Color backgroundColor = Colors.grey, PdfPageLayoutFunction? layoutPages, double maxScale = 8.0, double minScale = 0.1, bool useAlternativeFitScaleAsMinScale = true, PanAxis panAxis = PanAxis.free, EdgeInsets? boundaryMargin, PdfAnnotationRenderingMode annotationRenderingMode = PdfAnnotationRenderingMode.annotationAndForms, PdfPageAnchor pageAnchor = PdfPageAnchor.topCenter, bool enableTextSelection = false, bool panEnabled = true, bool scaleEnabled = true, GestureScaleEndCallback? onInteractionEnd, GestureScaleStartCallback? onInteractionStart, GestureScaleUpdateCallback? onInteractionUpdate, PdfViewerDocumentChangedCallback? onDocumentChanged, PdfViewerCalculateInitialPageNumberFunction? calculateInitialPageNumber, PdfViewerReadyCallback? onViewerReady, PdfPageChangedCallback? onPageChanged, PdfViewerParamGetPageRenderingScale? getPageRenderingScale, double? scrollByMouseWheel = 0.2, double scrollByArrowKey = 25.0, int maxImageBytesCachedOnMemory = 100 * 1024 * 1024, double horizontalCacheExtent = 1.0, double verticalCacheExtent = 1.0, PdfViewerOverlaysBuilder? viewerOverlayBuilder, PdfPageOverlaysBuilder? pageOverlaysBuilder, PdfViewerLoadingBannerBuilder? loadingBannerBuilder, PdfViewerErrorBannerBuilder? errorBannerBuilder, PdfLinkWidgetBuilder? linkWidgetBuilder, List<
PdfViewerPagePaintCallback> ? pagePaintCallbacks, PdfViewerTextSelectionChangeCallback? onTextSelectionChange, bool forceReload = false}) -
const
Properties
- annotationRenderingMode → PdfAnnotationRenderingMode
-
Annotation rendering mode.
final
- backgroundColor → Color
-
Background color of the viewer.
final
- boundaryMargin → EdgeInsets?
-
See InteractiveViewer.boundaryMargin for details.
final
- calculateInitialPageNumber → PdfViewerCalculateInitialPageNumberFunction?
-
Function to calculate the initial page number.
final
-
Enable keyboard navigation. The default is true.
final
- enableTextSelection → bool
-
Experimental: Enable text selection on pages.
final
- errorBannerBuilder → PdfViewerErrorBannerBuilder?
-
Build loading error banner.
final
- forceReload → bool
-
Force reload the viewer.
final
- getPageRenderingScale → PdfViewerParamGetPageRenderingScale?
-
Function to customize the rendering scale of the page.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- horizontalCacheExtent → double
-
The horizontal cache extent specified in ratio to the viewport width. The default is 1.0.
final
- layoutPages → PdfPageLayoutFunction?
-
Function to customize the layout of the pages.
final
- linkWidgetBuilder → PdfLinkWidgetBuilder?
-
Build link widget.
final
- loadingBannerBuilder → PdfViewerLoadingBannerBuilder?
-
Build loading banner.
final
- margin → double
-
Margin around the page.
final
- maxImageBytesCachedOnMemory → int
-
Restrict the total amount of image bytes to be cached on memory. The default is 100 MB.
final
- maxScale → double
-
The maximum allowed scale.
final
- minScale → double
-
The minimum allowed scale.
final
- onDocumentChanged → PdfViewerDocumentChangedCallback?
-
Function to notify that the document is loaded/changed.
final
- onInteractionEnd → GestureScaleEndCallback?
-
See InteractiveViewer.onInteractionEnd for details.
final
- onInteractionStart → GestureScaleStartCallback?
-
See InteractiveViewer.onInteractionStart for details.
final
- onInteractionUpdate → GestureScaleUpdateCallback?
-
See InteractiveViewer.onInteractionUpdate for details.
final
- onPageChanged → PdfPageChangedCallback?
-
Function called when the current page is changed.
final
- onTextSelectionChange → PdfViewerTextSelectionChangeCallback?
-
Function to be notified when the text selection is changed.
final
- onViewerReady → PdfViewerReadyCallback?
-
Function called when the viewer is ready.
final
- pageAnchor → PdfPageAnchor
-
Anchor to position the page.
final
- pageOverlaysBuilder → PdfPageOverlaysBuilder?
-
Add overlays to each page.
final
-
pagePaintCallbacks
→ List<
PdfViewerPagePaintCallback> ? -
Page paint callbacks.
final
- panAxis → PanAxis
-
See InteractiveViewer.panAxis for details.
final
- panEnabled → bool
-
See InteractiveViewer.panEnabled for details.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleEnabled → bool
-
See InteractiveViewer.scaleEnabled for details.
final
- scrollByArrowKey → double
-
Amount of pixels to scroll by arrow keys. The default is 25.0.
final
- scrollByMouseWheel → double?
-
Set the scroll amount ratio by mouse wheel. The default is 0.2.
final
- useAlternativeFitScaleAsMinScale → bool
-
If true, the minimum scale is set to the calculated PdfViewerController.alternativeFitScale.
final
- verticalCacheExtent → double
-
The vertical cache extent specified in ratio to the viewport height. The default is 1.0.
final
- viewerOverlayBuilder → PdfViewerOverlaysBuilder?
-
Add overlays to the viewer.
final
Methods
-
doChangesRequireReload(
PdfViewerParams? other) → bool - Determine whether the viewer needs to be reloaded or not.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
covariant PdfViewerParams other) → bool -
The equality operator.
override