How can we achieve infinite slider/swiper like this in flutter?

270 views Asked by At

Is there any library or plugin that has the feature to enable infinite scroll with a slider/swiper view like the one below? I have searched for similar sliders, but I haven't found any. infinite horizontal image slider

1

There are 1 answers

1
Gwhyyy On

you can just use the PageView.builder() and not specifying the itemCount

final yourPageController= PageController(initialPage: 10000);

PageView.builder(
      controller: yourPageController,
      itemBuilder: (context, index) {
        return Center(
          child: Text('page number $index'),
        );
      },
   ),

since I didn't specify the itemCount, it's now an infinite PageView that you can use and customize.