calculateSize method

  1. @override
Size calculateSize(
  1. int count
)
override

Calculates the size of canvas based on dots count, size and spacing

Implementers can override this function to calculate their own size

Implementation

@override
Size calculateSize(int count) {
  /// Add the scaled dot width to our size calculation
  var width = (dotWidth + spacing) * (min(count, maxVisibleDots));
  if (fixedCenter && count <= maxVisibleDots) {
    width = ((count * 2) - 1) * (dotWidth + spacing);
  }
  return Size(width, dotHeight * activeDotScale);
}