Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layoutPages isn't enough #217

Open
ameliacode opened this issue Jul 28, 2024 · 3 comments
Open

layoutPages isn't enough #217

ameliacode opened this issue Jul 28, 2024 · 3 comments

Comments

@ameliacode
Copy link

ameliacode commented Jul 28, 2024

Hi I am trying to make a book-like pdf viewer.
these are my requirements for the viewer

  • horizontally scrollable with snapping event
  • two pages should be viewed fully (two pages will be centered).
  • when the user taps right for example, pdf viewer should scroll automatically to next page.

I did figure out building it by utilizing PdfDocumentViewBuilder
However, when I had to implement the third requirement(scrolling automatically), it seems that I have to use PdfViewerController(I know this controller is PdfViewer based).

But as far as I know, if I change to PdfViewer, parameter for layoutPage doesn't work with snapping event..

anyway image down below, is what I have made so far.
I need to implement goToPage.. But it is impossible if I use PdfDocumentViewerBuilder. This is so frustrating..
GIF 2024-04-16 오후 10-21-55

@ameliacode
Copy link
Author

I've managed to recreate my own "goToPage" for scroll snap list built inside PdfDocumentViewerBuilder
I just use the state manager for the scroll snap list. (orientation though, works a bit off tho,,)

Anyway, similar function should be added in the future in Pdfviewer for future use.

@musaffa
Copy link

musaffa commented Aug 31, 2024

@ameliacode How did you implement the snap effect? Can you please share your code?

@ameliacode
Copy link
Author

ameliacode commented Sep 2, 2024

@ameliacode How did you implement the snap effect? Can you please share your code?

Hi musaffa, unfortunately I cannot fully open my code. However I can give you some hints for viewer..

In my previous version, I used the package called scroll snap list and wrapped around with PageDocumentViewBuilder. Somehow, this got orientation error on calculating the offset, so in my current version I have switched to PageView.builder

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants