transform method

  1. @override
Offset transform(
  1. double t
)
override

Returns the value of the object at point t.

The value of t is nominally a fraction in the range 0.0 to 1.0, though in practice it may extend outside this range.

See also:

Implementation

@override
Offset transform(double t) {
  PathMetrics pathMetrics = path.computeMetrics();
  PathMetric pathMetric = pathMetrics.elementAt(0);
  t = pathMetric.length * t;
  Tangent? pos = pathMetric.getTangentForOffset(t);
  return invertOffset ? -pos!.position : pos!.position;
}