when scrolling i don’t want to show prev page,
i want to scroll directly to the next page.
(I DONT WANT TO SHOW 50% OF THE CURRENT PAGE AND 50% OF THE NEXT PAGE)
CODE :
final _balancePageController = PageController(
initialPage: 0,
);
Container(
width: 245,
height: 256,
child: PageView(
controller: _balancePageController,
children: [
BalanceWidget(
imagePath: 'assets/images/ic_home_balance_cash.png',
balance: 369.820,
),
BalanceWidget(
imagePath:
'assets/images/ic_home_balance_restoration.png',
balance: 0,
),
BalanceWidget(
imagePath: 'assets/images/ic_home_balance_medical.png',
balance: 0,
),
],
),
),-
2
Answers
I used
GestureDetector
and detect swiping.Code:
Result:
In this way user can stop between 2 pages.
maybe there is a better solution ?
You can try setting the PageView’s
PageScrollPhysics
property.