addDashGap method

void addDashGap(
  1. PathMetric metric,
  2. double dashGapLength
)

Implementation

void addDashGap(PathMetric metric, double dashGapLength) {
  final end = _calculateLength(metric, _remainingDashGapLength);
  final availableEnd = _calculateLength(metric, dashGapLength);
  Tangent tangent = metric.getTangentForOffset(end)!;
  path.moveTo(tangent.position.dx, tangent.position.dy);
  final delta = end - extractedPathLength;
  _remainingDashGapLength = _updateRemainingLength(
    delta: delta,
    end: end,
    availableEnd: availableEnd,
    initialLength: dashGapLength,
  );
  extractedPathLength = end;
  _previousWasDash = false;
}