DocViewerController class

Controller to programmatically navigate, zoom, search, switch reading modes, and inspect document pages in PdfViewer and DocxViewer.

Constructors

DocViewerController({double initialZoom = 1.0, int initialPage = 1, DocReadingMode initialReadingMode = DocReadingMode.paper})

Properties

currentMatch → int
Active highlighted match index (1-based).
no setter
currentPage → int
Current 1-based active page.
no setter
hashCode → int
The hash code for this object.
no setterinherited
onJumpToPage ↔ void Function(int page)?
getter/setter pair
onNextMatch ↔ void Function()?
getter/setter pair
onPrevMatch ↔ void Function()?
getter/setter pair
onSearch ↔ void Function(String query)?
getter/setter pair
onSetReadingMode ↔ void Function(DocReadingMode mode)?
getter/setter pair
onSetZoom ↔ void Function(double scale)?
getter/setter pair
readingMode → DocReadingMode
Current reading mode (paper, dark, sepia).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchQuery → String
Current active search term.
no setter
showOutline → bool
Whether the Table of Contents sidebar is open.
no setter
tableOfContents → List<DocTocItem>
Extracted Table of Contents / Document Outline.
no setter
totalMatches → int
Total search occurrences found.
no setter
totalPages → int
Total number of pages in the loaded document.
no setter
zoom → double
Current zoom multiplier (e.g. 1.0 = 100%, 1.5 = 150%).
no setter

Methods

addListener(void listener()) → void
Adds a change listener.
jumpToPage(int page) → void
Navigates directly to page (1-indexed).
nextMatch() → void
Navigates to next search match.
nextPage() → void
Navigates to the next page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prevMatch() → void
Navigates to previous search match.
prevPage() → void
Navigates to the previous page.
removeListener(void listener()) → void
Removes a change listener.
resetZoom() → void
Resets zoom to 100%.
Executes full-text search across document pages.
setReadingMode(DocReadingMode mode) → void
Changes the active reading mode.
setZoom(double scale) → void
Updates zoom level to scale (clamped between 0.4x and 3.0x).
toggleOutline([bool? show]) → void
Toggles Table of Contents / Outline sidebar.
toggleReadingMode() → void
Cycles to next reading mode (paper -> dark -> sepia -> paper).
toString() → String
A string representation of this object.
inherited
updateDocumentMeta({int? currentPage, int? totalPages, List<DocTocItem>? toc}) → void
Sets document metadata (invoked by the viewer).
updateSearchMatches({required int current, required int total}) → void
Updates search match statistics.
zoomIn() → void
Increases zoom by 20%.
zoomOut() → void
Decreases zoom by 20%.

Operators

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