calculateIndexPosition function
Implementation
double calculateIndexPosition(int index, double totalWidth, {double indicatorWidth = 20}) {
var widthExcludingIndicators = totalWidth - indicatorWidth * 3;
var spaceSplitByIndicators = widthExcludingIndicators / 6;
var usedByOffIndicators = index * indicatorWidth;
var spacesCountBeforeCurrentIndicator = index * 2 + 1;
var usedBySpaces = spacesCountBeforeCurrentIndicator * spaceSplitByIndicators;
return usedBySpaces + usedByOffIndicators;
}