controller property

PdfViewerController? controller
final

Controller driving the document's scroll and zoom.

When null the viewer creates and owns its own. Supply one to read or change the reading position from outside the viewer — jumping to a page from a table of contents, restoring a saved position, or forwarding a drag that started on surrounding chrome (a collapsing header) into the document, which the viewer cannot receive itself because those gestures never reach its box.

The controller attaches to whichever viewer mounts last, so never share a single instance between two simultaneously mounted PdfViewers. It needs no disposal: it detaches itself when the viewer is disposed.

Read once, when the viewer is first built: swapping it on a later rebuild has no effect (give the viewer a new Key instead).

Its members throw until the document is ready — guard with rx.PdfViewerController.isReady.

Implementation

final rx.PdfViewerController? controller;