MoveAlongPathEffect constructor
MoveAlongPathEffect(
- Path path,
- EffectController controller, {
- bool absolute = false,
- bool oriented = false,
- PositionProvider? target,
- void onComplete()?,
- ComponentKey? key,
Implementation
MoveAlongPathEffect(
Path path,
EffectController controller, {
bool absolute = false,
bool oriented = false,
PositionProvider? target,
void Function()? onComplete,
super.key,
}) : _isAbsolute = absolute,
_followDirection = oriented,
super(
controller,
target,
onComplete: onComplete,
) {
final metrics = path.computeMetrics().toList();
if (metrics.length != 1) {
throw ArgumentError(
'Only single-contour paths are allowed in MoveAlongPathEffect',
);
}
_pathMetric = metrics[0];
_pathLength = _pathMetric.length;
assert(_pathLength > 0);
}