lerp method
- @override
override
Returns the value this variable has at the given animation clock value.
The default implementation of this method uses the +
, -
, and *
operators on T
. The begin and end properties must therefore be
non-null by the time this method is called.
Implementation
@override
Offset lerp(double t) {
if (_dirty)
_initialize();
if (t == 0.0)
return begin;
if (t == 1.0)
return end;
if (_beginAngle == null || _endAngle == null)
return Offset.lerp(begin, end, t);
final double angle = lerpDouble(_beginAngle, _endAngle, t);
final double x = math.cos(angle) * _radius;
final double y = math.sin(angle) * _radius;
return _center + Offset(x, y);
}