getDashCount method

int getDashCount()

Implementation

int getDashCount() {
  var fullLength = dashLength / positiveSpaceRatio;
  var dashCount = getLength() / fullLength;

  if (fullLength.isInfinite || dashCount.isInfinite) {
    // Dart doesn't throw an exception when dividing by zero
    // (only when using the ~/ integer division operator)
    return 1;
  }

  return dashCount.ceil();
}