How to create Vertically scrolling PageView in Flutter?

2,339

Use scrollDirection: Axis.vertical

PageView(
    controller: pageViewController,
    scrollDirection: Axis.vertical,
    children: [Page1(), Page2()],
)
Share:
2,339
Rishabh Bhardwaj
Author by

Rishabh Bhardwaj

Updated on December 14, 2022

Comments

  • Rishabh Bhardwaj
    Rishabh Bhardwaj over 1 year

    PageView by default has horizontal scrolling in flutter, but I need to create a vertically scrollable Pages through PageView, any solution ??

    • Thor
      Thor over 4 years
      Maybe take a look at this. There seems to be a guide to transition for vertical PageView.
    • Nikunj Kumbhani
      Nikunj Kumbhani over 4 years
      Please check this maybe this one helps you pub.dev/packages/flutter_swiper
  • sharib ahmed
    sharib ahmed almost 2 years
    @AskNilesh , even after adding scroll direction vertical my pageview is scrolling horizontally. I don't understand why!! P.S.: I am using pageView.builder()
  • sharib ahmed
    sharib ahmed almost 2 years
    I have this app with tik tok pr Instagram reels like UI/UX, currently, I am using TabView to achieve vertical scrolling but it's not good in terms of performance.