PdfTextSearcher class

Helper class to interactively search text in a PDF document.

To be notified when the search status change, use addListener.

Inheritance

Constructors

PdfTextSearcher(PdfViewerController _controller)
Creates a new instance of PdfTextSearcher.

Properties

controller PdfViewerController?
The PdfViewerController to use.
no setter
currentIndex int?
The current match index in matches if available.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasMatches bool
Whether there are any matches or not (so far).
no setter
isSearching bool
Whether the search task is currently running or not
no setter
matches List<PdfTextRangeWithFragments>
Get the current matches.
no setter
pattern Pattern?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchingPageNumber int?
The page currently being searched.
no setter
searchProgress double?
no setter
searchSession int
no setter
totalPageCount int?
no setter

Methods

addListener(VoidCallback listener) VoidCallback
Register a closure to be called when the object notifies its listeners.
override
dispose() → void
Almost identical to resetTextSearch, but does not notify listeners.
getMatchesRangeForPage(int pageNumber) → ({int end, int start})?
Get the matches range for the given page number.
goToMatch(PdfTextRangeWithFragments match) Future<void>
Go to the given match.
goToMatchOfIndex(int index) Future<int>
Go to the match of the given index.
goToNextMatch() Future<int>
Go to the next match.
goToPrevMatch() Future<int>
Go to the previous match.
loadText({required int pageNumber}) Future<PdfPageText?>
Just a helper function to load the text of a page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
pageTextMatchPaintCallback(Canvas canvas, Rect pageRect, PdfPage page) → void
Paint callback to highlight the matches.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
override
resetTextSearch() → void
Reset the current search.
startTextSearch(Pattern pattern, {bool caseInsensitive = true, bool goToFirstMatch = true, bool searchImmediately = false}) → void
Start a new search.
toString() String
A string representation of this object.
inherited

Operators

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