PdfViewerController class

Controller for PdfViewer. It is derived from TransformationController and basically compatible to ValueNotifier<Matrix4>. So you can pass it to ValueListenableBuilder<Matrix4> or such to receive any view status changes.

Inheritance

Constructors

PdfViewerController()

Properties

currentPageNumber → int
Get the current page number by obtaining the page that has the largest area from visiblePages.
no setter
fullSize → Size
Get the full PDF content size in the PdfViewer.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isReady → bool
Whether the controller is ready or not.
no setter
offset → Offset
Current view offset (top-left corner coordinates).
no setter
pageCount → int
Get total page count in the PDF document.
no setter
ready → PdfViewerController?
Helper method to return null when the controller is not ready(isReady).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollableMax → Offset
Get the maximum scrollable offset in the PdfViewer.
no setter
value ↔ Matrix4
The current value stored in this notifier.
getter/setter pairinherited
viewRect → Rect
Current view rectangle.
no setter
viewSize → Size
Get the PdfViewer's view size.
no setter
visiblePages → Map<int, double>
Get list of the page numbers of the pages visible inside the viewport.
no setter
zoomRatio → double
Current view zoom ratio.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
calculatePageFitMatrix({required int pageNumber, double? padding}) → Matrix4?
Calculate the matrix that corresponding to the page position.
calculatePageMatrix({required int pageNumber, double? padding, double x = 0.5, double y = 0.5, PdfViewerAnchor anchor = PdfViewerAnchor.center, double? zoomRatio}) → Matrix4?
Calculate the matrix that corresponding to the page of specified offset (x, y) and specified zoomRatio.
clampX(double x, double zoomRatio) → double
Clamp horizontal scroll position into valid range.
clampY(double y, double zoomRatio) → double
Clamp vertical scroll position into valid range.
dispose() → void
Discards any resources used by the object.
inherited
getFullSize(double zoomRatio) → Size
Get the full PDF content size in the PdfViewer with the specified zoomRatio.
getPage(int pageNumber) → Future<PdfPage>
Get the page.
getPageRect(int pageNumber) → Rect?
Get page location. If the page does not exist in the layout, it returns null.
getScrollableMaxX(double zoomRatio) → double
Calculate maximum X that can be acceptable as a horizontal scroll position.
getScrollableMaxY(double zoomRatio) → double
Calculate maximum Y that can be acceptable as a vertical scroll position.
goTo({Matrix4? destination, Duration duration = const Duration(milliseconds: 200)}) → Future<void>
Go to the destination specified by the matrix.
goToPage({required int pageNumber, double? padding, Duration duration = const Duration(milliseconds: 500)}) → Future<void>
Go to the specified page.
goToPointInPage({required int pageNumber, double? padding, double x = 0.5, double y = 0.5, PdfViewerAnchor anchor = PdfViewerAnchor.center, double? zoomRatio, Duration duration = const Duration(milliseconds: 500)}) → Future<void>
Go to specific point in page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setZoomRatio({required double zoomRatio, Offset? center, Duration duration = const Duration(milliseconds: 200)}) → Future<void>
Set zoom ratio.
toScene(Offset viewportPoint) → Offset
Return the scene point at the given viewport point.
inherited
toString() → String
A string representation of this object.
inherited
zoomMatrix(double zoomRatio, {Offset? center}) → Matrix4
Calculate the matrix that changes zoom ratio.

Operators

operator ==(Object other) → bool
The equality operator.
inherited