dartflutter

PageView: Disable the default scrolling and replace it with Tap event


If I have a PageView, how can I disable the default scroll behavior (swiping) and make it such that the next item is scrolled into view by tapping on a button instead?


Solution

  • To disable swiping you can set:

    PageView(physics: const NeverScrollableScrollPhysics())