indicators function

List<Widget> indicators(
  1. dynamic imagesLength,
  2. dynamic currentIndex,
  3. dynamic height,
  4. dynamic width,
  5. dynamic activeColor,
  6. dynamic inactiveColor,
)

Implementation

List<Widget> indicators(
    imagesLength, currentIndex, height, width, activeColor, inactiveColor) {
  return List<Widget>.generate(imagesLength, (index) {
    return Container(
      margin: const EdgeInsets.all(3),
      width: width,
      height: height,
      decoration: BoxDecoration(
        color: currentIndex == index ? activeColor : inactiveColor,
        shape: BoxShape.circle,
      ),
    );
  });
}