Open DanilKarasev opened 1 year ago
Swiper(
control: kIsWeb && isLargeScreen && itemsCount > 1
? const CustomHorizontalSwiperControl(size: 25)
: null,
scale: 0.75,
scrollDirection: Axis.horizontal,
controller: controller,
itemCount: itemsCount,
loop: false,
pagination: itemsCount > 1
? SwiperCustomPagination(
builder: (BuildContext context, SwiperPluginConfig config) {
return Align(
alignment: Alignment.bottomCenter,
child: PageIndicator(
count: config.itemCount,
controller: config.pageController!,
layout: PageIndicatorLayout.SCALE,
size: 10,
activeColor: Theme.of(context).primaryColor,
color: HERE something like index == 1 ? Colors.black : Theme.of(context).disabledColor,
space: 5,
),
);
},
)
: null,
itemBuilder: (context, index) {
return Text('$index');
},
);
I want to have different colors for each pagination item based on the card content. But since I don't have access to index there - I couldn't find a way to do that. Any suggestions? Thanks.