setPage method
Navigates to page pageIndex, clamped to [0, pageCount - 1].
pageCount is the total number of pages in the document. When pageCount
is 0, the call is a no-op. Notifies listeners if the page changed.
Implementation
void setPage(int pageIndex, {required int pageCount}) {
if (pageCount <= 0) return;
final clamped = pageIndex.clamp(0, pageCount - 1);
if (_currentPage == clamped) return;
_currentPage = clamped;
notifyListeners();
}