build method
Implementation
@override
Widget build(BuildContext context, int index, int itemCount) {
if (itemCount == 1) return const SizedBox(width: .0, height: .0);
var children = List.generate(itemCount, (_index) {
Color color = itemColor;
if (_index == index) {
color = itemActiveColor ?? Theme.of(context).colorScheme.secondary;
}
return Container(
width: itemWidth,
height: itemHeight,
decoration: BoxDecoration(color: color, shape: itemShape),
);
});
return Padding(
padding: padding ?? const EdgeInsets.all(10.0),
child: Wrap(
runSpacing: spacing,
spacing: spacing,
children: children,
),
);
}