pdfrx icon indicating copy to clipboard operation
pdfrx copied to clipboard

PdfViewer is slow when scrolling on mobile, is there settings to speed it up ?

Open G705-Ghilan opened this issue 1 month ago • 5 comments

Hi, first of all, thanks for you amazing work on this lib @espresso3389 we really appreciate as the flutter community

now the PdfViewer is pretty slow at scrolling than the normal list in flutter i saw some settings in the class related to scrolling but could you please clarify if there is a settings to make it just normal speed scrolling like other flutter lists

for now with the default params of PDFViewer it is pretty slow on mobile (test it on android only tho)

would be really happy to hear your response

G705-Ghilan avatar Nov 17 '25 05:11 G705-Ghilan

By chance, I added scrollPhysics and scrollPhysicsScale params and it somehow make the PDF scroll speed more natural.

params: const PdfViewerParams(
              scrollPhysics: FixedOverscrollPhysics(maxOverscroll: 100),
              scrollPhysicsScale: BouncingScrollPhysics(),
)

I don't know if it is a legitimate fix or not.

SlickSlime avatar Nov 17 '25 07:11 SlickSlime

Thanks that worked well @SlickSlime 👍

G705-Ghilan avatar Nov 17 '25 10:11 G705-Ghilan

By chance, I added scrollPhysics and scrollPhysicsScale params and it somehow make the PDF scroll speed more natural.

params: const PdfViewerParams( scrollPhysics: FixedOverscrollPhysics(maxOverscroll: 100), scrollPhysicsScale: BouncingScrollPhysics(), ) I don't know if it is a legitimate fix or not.

Yes, this is exactly what scrollPhysics is for. FixedOverscrollPhysics is good for Android, but if you want to support iOS too, then you want to use BouncingScrollPhysics() which has quite a different scrolling behavior. You can just use this convenience method and it works for both:

scrollPhysics: PdfViewerParams.getScrollPhysics(context)

enhancient avatar Nov 26 '25 01:11 enhancient

So if many users feel that the scroll speed is slow, should we provide appropriate (faster) default value for PdfViewerParams.getScrollPhysics?

Or if #547 is fixed, should we use the value from PdfViewerParams.getScrollPhysics as the default value for null case?

espresso3389 avatar Nov 26 '25 05:11 espresso3389

So if many users feel that the scroll speed is slow, should we provide appropriate (faster) default value for PdfViewerParams.getScrollPhysics?

Or if #547 is fixed, should we use the value from PdfViewerParams.getScrollPhysics as the default value for null case?

It's going to be a changed experience for users, but a positive one. Perhaps for version 3.0 we make it the default when scrollPhysics is not specified as you suggest. Good to do this change on a major release.

enhancient avatar Nov 26 '25 06:11 enhancient