In my book-like Flutter app, there is a requirement to swipe in horizontal direction in order to navigate to previous and next page. I looked for a package which does something like that in pub.dev and didn't find. I'd like to know if there is already something like that to not-invent a wheel. If not, I'd like to hear (not excepting you to make it for me) what approach can be taken in order to implement it by myself.
Asked
Active
Viewed 211 times
-1
-
I guess you are looking for this package [swipedetector](https://pub.dev/packages/swipedetector) – Mohammed Alfateh Dec 01 '21 at 12:09
1 Answers
1
What you're looking for is the PageView widget. Just provide the pages, the swiping functionality is built-in.
PageView(
controller: _controller,
children: [
MyPage1Widget(),
MyPage2Widget(),
MyPage3Widget(),
],
)
Since you're saying it's for a book which likely has a lot of pages you might want to use PageView.builder() instead of better performance.
There's a more information about the widget here

Alex Schneider
- 364
- 2
- 7
-
As mentioned, I looked at pub.dev, but didn't think that a standard component might exists... I took my lesson. It works great with PageView.builder. thanks. – Dorad Dec 02 '21 at 19:40