I'm making a slideable banner inside a Gridview By using

GridView.count(
    childAspectRatio: height / width,
    scrollDirection: Axis.horizontal,
    children: generateList(),
    crossAxisCount: 1,        
)

the child size will take the full width of the GridView. but now I need to make the scroll behavior become snapping per page like scrolling/swiping your phone at home screen.

is there any way to achieve such behavior?

1 Answers

0
Tek Yin On Best Solutions

as @pskink state on the comment. PageView really do the job.

PageView(
   scrollDirection: Axis.horizontal,
   children: generateList(),
)

Too bad he didn't response my comment, so I decided to put his answer here so it can help anyone with the same problem