ThomasF
ThomasF

Reputation: 177

How ListView can Stop at each element in Flutter

My question is very simple but I did not find a result.

In a ListView.builder (with horizontal scroll) for example if there are 5 elements the user can scroll them all at once. I would like that the user can scroll only 1 by 1.

In short I would like the animation of the list to stop at each element.

Example of my list :

Widget _list()
  {
    return ListView.builder(
        physics: const ClampingScrollPhysics(),
        scrollDirection: _horizontalDisplay? Axis.horizontal : Axis.vertical,
        itemCount: data!.length,
        itemBuilder: (context, index)
        {
          return widgetToDisplay(index);
        }
    );
  }

Upvotes: 0

Views: 578

Answers (1)

Koffi Innocent Konan
Koffi Innocent Konan

Reputation: 310

The ListView.builder can't make it, you need to use carousel_slider package

Upvotes: 1

Related Questions