fujidaiti / exprollable_page_view

Yet another PageView widget that expands its viewport as it scrolls. Exprollable is a coined word combining the words expandable and scrollable.
https://pub.dev/packages/exprollable_page_view
MIT License
74 stars 5 forks source link

Right - Left swipe during the full size screen #44

Open fujidaiti opened 1 year ago

fujidaiti commented 1 year ago

Discussed in https://github.com/fujidaiti/exprollable_page_view/discussions/43

Originally posted by **VeskoDev** June 14, 2023 First of all, I have to say that the package works perfectly, but what I need is a scroll system that works on the initial opening of the page view, which has a standard page view. My question is, what would be the easiest way and does this package provide the capability to scroll from page to page even though I'm on a full-size page?
fujidaiti commented 1 year ago

With the current implementation, there are 2 problems that must be solved before we can provide the option to always allow the pagination:

The former can be fixed by changing the way to calculate the visual positions of each page (see the working branch).

The later is, say, you vertically scroll certain pixels up the page A and horizontally swipe to the next page B keeping the vertical scroll position of A, then vertically scroll down B to the top to shrink the pages. If you horizontally swipe back to A, you should notice that the vertical scroll position of A is not at the top even though the pages have been fully shrunk (see the video at the bottom). To solve this problem, it is necessary to synchronize (set to 0) the scroll position of all pages at some point, but it is not clear where this should be done. A naive idea is to reset the scroll positions to 0 when the pages are completely switched, but this solution has a downside that the scroll position is not preserved before and after switching pages.

https://github.com/fujidaiti/exprollable_page_view/assets/68946713/371095a0-a4d0-40ec-8af2-b17b59763bb9

VeskoDev commented 1 year ago

Maybe in this situation, we can have 2 controllers, one default with a default viewport fraction like 0.96 for example, and when the page is changed (we can use the built-in onPageChanged function) we can just switch to that default controller and that will reset and switch to default mode for viewport fraction?