packages.flutter
packages.flutter copied to clipboard
pdfx web - bouncing behaviour is quite annoying when scrolling
Describe the bug
When scrolling a lager PDF with the mouse (especially with smaller wheel spin) the scrolling behavoiur with it's bouncing is quite annoying.
As you can see here in this animation you even get stuck sometimes on the same place (e.g. at page break):
To Reproduce
I'm taking a fileBase64Decoded
PDF but this shouldn't matter though. It just needs to be multiple pages.
I tried playing around a bit with pageSnapping
and the physics
but there was no real satisfiying result.
Behaviour is same in Chrome and Edge.
PdfController? pdfController = PdfController(
document: PdfDocument.openData(fileDecoded),
);
PdfView(
controller: pdfController!,
scrollDirection: Axis.vertical,
pageSnapping: !kIsWeb,
physics: PageScrollPhysics(),
builders: PdfViewBuilders<DefaultBuilderOptions>(
options: const DefaultBuilderOptions(),
documentLoaderBuilder: (context) => Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor),
),
),
pageLoaderBuilder: (context) => Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor),
),
),
),
);
Expected behavior
pageSnapping: false
should actually not pageSnap
OR
Based on the given ScrollPhysics an according scrolling behaviour, e.g.
- bouncing when
BouncingScrollPhysics
- maintaining the amount of overscroll or underscroll when
RangeMaintainingScrollPhysics
OR
it would actually be nice to have a scrollbar available, like already mentioned in #81.
Maybe it would also be worth a try to implement it's own ScrollController
to kinda control the scroll behaviour on your own. But it seems like this whole scrolling stuff is somewhere deep in related packages like photo_view_gallery.
My idea was to create some sort of controller like here in this package and wrap the PdfView with it: https://pub.dev/packages/smooth_scroll_web
Are there any news regarding this issues. We still have this behavior. Do you have planned to provide a fix for it? Many thanks for your response.
I would like to push resolution of this issue 🙏 I like the library but this bounding behaviour while viewing PDF will probably make me search for another library if not resolved soon.
Same as @FilipObornik, the library is quite useful but having no control over scrolling is annoying