onStart method
This method is called once when the effect is about to start, but before
the first call to apply()
. The notion of "about to start" is defined by
the controller: this method is called when controller.started
property
first becomes true.
If the effect is reset, its onStart()
method will be called again when
the effect is about to start.
Implementation
@override
void onStart() {
_lastOffset = Vector2.zero();
_lastAngle = 0;
if (_isAbsolute) {
final start = _pathMetric.getTangentForOffset(0)!;
target.position.x = _lastOffset.x = start.position.dx;
target.position.y = _lastOffset.y = start.position.dy;
if (_followDirection) {
target.angle = _lastAngle = -start.angle;
}
}
}