Skip to content

When setting index via setPage of pdfViewController, the page jumped to is not centered. #116

@wanwanrich

Description

@wanwanrich

Describe the bug
In landscape mode,
When setting index via setPage of pdfViewController, the page jumped to is not centered.
When I slide, the page I jump to is centered.

To Reproduce
Steps to reproduce the behaviour:

  1. I have two buttons to control the pdf forward and backward。
  2. When I use pdfViewController.setPage, the pdf is not centered in window。

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Right condition:
Image

But i get:

Image

Smartphone (please complete the following information):

  • Android sdk verion 34

Additional context
Add any other context about the problem here.
I config the window in landscape mode in inState。

void initState() {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}

Also, I config swipeHorizontal as true. And the pageSnap is ture.
PDF pdf = PDF(
fitPolicy: fitPolicy,
pageSnap: true,
swipeHorizontal: true,)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions