calculate method
this represent calculation of offset from path metrics
Implementation
Offset? calculate(value, Path path) {
PathMetrics pathMetrics = path.computeMetrics();
PathMetric pathMetric = pathMetrics.elementAt(0);
value = pathMetric.length * value;
Tangent? pos = pathMetric.getTangentForOffset(value);
return pos?.position;
}