0

I'm using a PageView for my Flutter App, but I just realized that I don't know how to stop scrolling at a certain point like a drawer, but flutter drawer simply covers the page underneath, so here is the ideal scenario I want:

Ideal pageview

And you cannot scroll anymore after reached that certain point, the same effect as the Profile Page of Instagram :)

And this is a normal drawer:

Normal drawer

Ryan Wang
  • 418
  • 7
  • 23

1 Answers1

-1

If you want to stop the pages in PageView without snapping to the next or previous page automaically, you can set the parameter pageSnapping to false.

Below is the example.

    final PageController controller = PageController(initialPage: 0);
    return PageView(
      scrollDirection: Axis.horizontal,
      pageSnapping:false,
      controller: controller,
      children: const <Widget>[
        Center(
          child: Text('First Page'),
        ),
        Center(
          child: Text('Second Page'),
        ),
        Center(
          child: Text('Third Page'),
        )
      ],
    );
CrimsonFoot
  • 325
  • 3
  • 13
  • Actually, I don't wanna just stoppage snapping, but you cannot scroll anymore after reached a certain point :) – Ryan Wang May 31 '21 at 03:33