build method
Implementation
@override
Widget build(BuildContext context, FlSwiperPluginConfig config) {
if (config.itemCount > 20) {
log('The itemCount is too big, we suggest use FlSwiperFractionPaginationBuilder instead of FlSwiperDotPaginationBuilder in this sitituation');
}
Color? activeColor = this.activeColor;
Color? color = this.color;
if (activeColor == null || color == null) {
final ThemeData themeData = Theme.of(context);
activeColor = this.activeColor ?? themeData.colorScheme.primary;
color = this.color ?? themeData.unselectedWidgetColor;
}
return Flex(
key: key,
direction: config.scrollDirection,
mainAxisSize: MainAxisSize.min,
children: config.itemCount.generate((int i) {
final bool active = i == config.activeIndex;
return Container(
key: Key('pagination_$i'),
margin: EdgeInsets.all(space),
child: ClipOval(
child: Container(
color: active ? activeColor : color,
width: active ? activeSize : size,
height: active ? activeSize : size),
));
}));
}