I have a pageview and when i added padding to the whole pageview and while scrolling when widget is about to finish the padding area the widget get removed from the screen view. This issue is not there if i remove padding. I also added clipbehaviour so that it clips to the both boundary while scrolling.
I need to have a continuous scrolling between pages.
Padding(
padding: const EdgeInsets.all(20.0),
child: PageView(
controller: _pageController,
padEnds: false,
pageSnapping: false,
clipBehavior: Clip.none,
children: [
for (int idx = 0; idx < 10; idx++)
Container(
decoration: BoxDecoration(
color:Color((math.Random().nextDouble() * 0xFFFFFF).toInt()).withOpacity(1.0),
border: Border.all(color: Colors.blue)
),
height: 150,
width: double.infinity,
),
],
),
)
NOTE : Issue is not there if i remove padding, but i need to have a continous scroll with applying padding.
2
Answers
Try changing the clipBehaviour to
Clip.antiAlias
I tried this and it worked well
Other solution could be to add the padding to the page view children, like this
If this is what you’re trying to achieve, then you can use
ListView
instead: