nextPage method
- required int pageCount,
Advances to the next page if not already on the last page.
pageCount is the total number of pages in the document. The call is a
no-op when already on the last page or when pageCount ≤ 0. Notifies
listeners if the page changed.
Implementation
void nextPage({required int pageCount}) {
if (pageCount <= 0) return;
final next = _currentPage + 1;
if (next >= pageCount) return;
_currentPage = next;
notifyListeners();
}