1 year ago

#326363

test-img

Ayme_99

Flutter Carousel, put side items behind the center card

I want to know how to put the carousel items behind the center item, then when it slides there will be no spaces between items but it will stay behind

I have this:

And I want somethig like this:

This is my code:

CarouselSlider(
            options: CarouselOptions(
              height: Sizes.width,
              enableInfiniteScroll: true,
              aspectRatio: 2.0,
              enlargeCenterPage: true,
              viewportFraction: 0.8,
              onPageChanged: (index, reason) =>
                  setState(() => currentCard = index),
            ),
            items: hardcore.map((i) {
              return Builder(builder: (BuildContext context) {
                return Container(
                    width: MediaQuery.of(context).size.width,
                    margin: EdgeInsets.symmetric(horizontal: 0),
                    child: ClipRRect(
                        borderRadius: BorderRadius.circular(20),
                        child: Image.asset(i, fit: BoxFit.cover)));
              });
            }).toList()),

flutter

carousel

flutter-widget

flutter-plugin

0 Answers

Your Answer

Accepted video resources