Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,6 @@ Widget build(BuildContext context) {
}

{% endhighlight %}
{% endtabs %}
{% endtabs %}

N> Avoid calling `setState()` inside the `onPageChanged` or `onDocumentLoaded` callbacks. Doing so rebuilds the entire widget tree — including the `SfPdfViewer` — which can decrease performance when viewing large PDF documents. Instead, use an `addListener()` to the `PdfViewerController` to monitor page changes and update only the specific UI elements that need to change (for example, the page number indicator). This keeps viewer rebuilds to a minimum and delivers smoother scrolling and better stability with large PDF files.