tabCenter method

double tabCenter(
  1. int index
)

Center of tab index: the end tabs' pills sit at the padding, and the others are evenly spaced between them.

Implementation

double tabCenter(int index) {
  final double first = _padding.left + pillWidth / 2;
  final double last = _size.width - _padding.right - pillWidth / 2;
  if (_count == 1) {
    return (first + last) / 2;
  }
  return first + index * (last - first) / (_count - 1);
}