flutter_carousel_slider icon indicating copy to clipboard operation
flutter_carousel_slider copied to clipboard

Too much left & right space when enableInfiniteScroll=false & viewportFraction<1

Open PoundXI opened this issue 4 years ago • 4 comments

I couldn't find any options to reduce space (show as red color) on left & right of carousel when enableInfiniteScroll = false, viewportFraction<1. It's too much space.

CarouselSlider(
  options: CarouselOptions(
    enableInfiniteScroll: false,
    viewportFraction: 0.4,
    disableCenter: true,
  ),
  items: [1, 2, 3, 4].map((i) => 
    Container(
      width: MediaQuery.of(context).size.width * 0.3,
      margin: EdgeInsets.only(right: 15),
      color: Colors.green,
      child: Text(i.toString()),
    ),
  ).toList(),
)

left-space right-space

PoundXI avatar May 10 '21 09:05 PoundXI

@PoundXI Hi, did you found any solution?

ghost avatar Jul 26 '21 18:07 ghost

@PoundXI Hi, did you found any solution?

No. I'm not found any solution.

PoundXI avatar Jul 27 '21 16:07 PoundXI

I have the same problem

tung21 avatar Aug 13 '21 11:08 tung21

Could this be solvable through the newly exposed padEnds on PageView? https://github.com/flutter/flutter/issues/78492

dimio5 avatar Sep 20 '21 14:09 dimio5