build method

  1. @override
Widget build(
  1. BuildContext context,
  2. int index,
  3. int itemCount
)
inherited

Implementation

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