calculate method

Offset? calculate(
  1. dynamic value,
  2. Path path
)

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;
}