dashPath method
Implementation
Path dashPath(
Path source, {
required CircularIntervalList<double> dashArray,
}) {
final Path dest = Path();
final ui.PathMetrics metrics = source.computeMetrics();
for (final metric in metrics) {
double distance = 0.0;
bool draw = true;
while (distance < metric.length) {
final double length = dashArray.next;
if (draw) {
dest.addPath(
metric.extractPath(distance, distance + length),
Offset.zero,
);
}
distance += length;
draw = !draw;
}
}
return dest;
}