PdfViewerController class Null safety

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. If no pages are visible, it returns 1. If the controller is not ready(isReady), the property throws an exception.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
isReady bool
Whether the controller is ready or not. If the controller is not ready, almost all methods on PdfViewerController won't work (throw some exception). For certain operations, it may be easier to use ready method to get PdfViewerController? not to execute methods unless it is ready.
read-only
pageCount int
Get total page count in the PDF document. If the controller is not ready(isReady), the property throws an exception.
read-only
ready PdfViewerController?
Helper method to return null when the controller is not ready(isReady). It is useful if you want ot call methods like goTo with the property like the following fragment: [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value Matrix4
The current value stored in this notifier. [...]
read / write, inherited
viewRect Rect
Current view rectangle. If the controller is not ready(isReady), the property throws an exception.
read-only
visiblePages Map<int, double>
Get list of the page numbers of the pages visible inside the viewport. The map keys are the page numbers. And each page number is associated to the page area (width x height) exposed to the viewport; If the controller is not ready(isReady), the property throws an exception.
read-only
zoomRatio double
Current view zoom ratio. If the controller is not ready(isReady), the property throws an exception.
read-only

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. If the page is out of view, it returns null. /// If the controller is not ready(isReady), the property throws an exception.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener and removeListener will throw after the object is disposed). [...]
@mustCallSuper, inherited
getPageRect(int pageNumber) Rect?
Get page location. If the page is out of view, it returns null. If the controller is not ready(isReady), the property throws an exception.
goTo({Matrix4? destination, Duration duration = const Duration(milliseconds: 200)}) Future<void>
Go to the destination specified by the matrix. To go to a specific page, use goToPage method or use calculatePageFitMatrix method to calculate the page location matrix. If destination is null, the method does nothing.
goToPage({required int pageNumber, double? padding, Duration duration = const Duration(milliseconds: 500)}) Future<void>
Go to the specified page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
toScene(Offset viewportPoint) Offset
Return the scene point at the given viewport point. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited