drawPartial static method
void
drawPartial(})
Draw progress (0..1) fraction of path using paint.
Internally uses ui.PathMetrics to extract a partial subpath.
Implementation
static void drawPartial(
Canvas canvas,
Path path,
Paint paint,
double progress, {
bool reverse = false,
}) {
if (progress <= 0) return;
if (progress >= 1) {
canvas.drawPath(path, paint);
return;
}
final metrics = path.computeMetrics();
for (final metric in metrics) {
final len = metric.length * progress;
final partial = metric.extractPath(0, len);
canvas.drawPath(partial, paint);
}
}