createAnimatedPath method
Implementation
Path createAnimatedPath(
Path originalPath,
double animationPercent,
) {
final totalLength = originalPath
.computeMetrics()
.fold(0.0, (double prev, PathMetric metric) => prev + metric.length);
final currentLength = totalLength * animationPercent;
return extractPathUntilLength(originalPath, currentLength);
}