Pagination difficulty
Thank you for this excellent work.
I have problems with pagination. I click to change the page and if there is no data on the device, I request it from the database. It is not a problem to click on the top arrows. However, it is very cool to change by dragging the screen. However, I could not find the horizontal listen of the pageController to call a new page (new month) in the database. I ended up using => pageViewPhysics: NeverScrollableScrollPhysics().
How can I capture the horizontal movement of the page turn to make the request to the database?
I did it, guys!. π
Returns a callback for the end of the pages. Either to the beginning or to the end. The user drags from the last page or the first and receives a callback for the pagination.
Please check here.
Consider including in the package.
Solution suggested and tested multiple times.
Pull Request - https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/453
Hi @MarceloRab,
Thank you for raising this issue and for providing a well-tested PR. We really appreciate your contribution!
However, we already have a callback onPageChange available, which can be used to listen to page change events. In your case, you could use this callback to check if the data exists and, if not, fetch it from the database.
Given that, it seems this change might not be necessary. That said, please let me know if Iβm missing something or if thereβs a specific use case that isnβt covered by the current approach.
If everything looks good, Iβll go ahead and close the issue and PR #453.
Thanks again!
Only with this change can we receive a callback with the movement in the PageView. Otherwise, we will need to use the arrows to know if it has reached the end. This does not generate a good user experience.