Kavin Raju S
Kavin Raju S

Reputation: 1382

How to make previous and next items visible using PageView in Flutter?

How to make the previous and the next items of a PageView visible at the ends of the screen slightly?

enter image description here

Upvotes: 5

Views: 4495

Answers (3)

Anna Muzykina
Anna Muzykina

Reputation: 310

To make next and previous card visible you can try to use in PageView viewportFraction

https://www.youtube.com/watch?v=_uuFKMCA1m4

Upvotes: 1

Gary AP
Gary AP

Reputation: 797

First you need to specify the page controller's viewport fraction which defaults to 1.0 :

final _controller = PageController(viewportFraction: 0.7);

Then use the custom controller for your page view:

PageView.builder(
              itemCount: _pages.length,
              controller: _controller,
              itemBuilder: (BuildContext context, int index) {
                return _pages[index];
              },
            )

Upvotes: 16

You need to reduce the width of the pages in the page view so you can display more

Upvotes: -2

Related Questions