dashPath function
Path?
dashPath(
- Path? source, {
- required CircularIntervalList<
double> dashedarray, - DashOffset dashOffset = const DashOffset.absolute(0),
Implementation
Path? dashPath(Path? source,
{required CircularIntervalList<double> dashedarray,
DashOffset dashOffset = const DashOffset.absolute(0)}) {
if (source == null) {
return null;
}
final Path dest = Path();
for (final PathMetric metric in source.computeMetrics()) {
double distance = dashOffset._calculate(metric.length);
bool draw = true;
while (distance < metric.length) {
final double len = dashedarray.next;
if (draw) {
dest.addPath(metric.extractPath(distance, distance + len), Offset.zero);
}
distance += len;
draw = !draw;
}
}
return dest;
}