'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
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()),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
