moveToPositionAnimated method
void
moveToPositionAnimated({
- required Vector2 position,
- EffectController? effectController,
- double? zoom,
- double? angle,
- dynamic onComplete()?,
Implementation
void moveToPositionAnimated({
required Vector2 position,
EffectController? effectController,
double? zoom,
double? angle,
Function()? onComplete,
}) {
stop();
var controller = effectController ?? EffectController(duration: 1);
final moveToEffect = MoveToEffect(
position,
controller,
onComplete: onComplete,
);
viewfinder.add(moveToEffect);
if (zoom != null) {
final zoomEffect = ScaleEffect.to(
Vector2.all(zoom),
controller,
);
zoomEffect.removeOnFinish = true;
viewfinder.add(zoomEffect);
}
if (angle != null) {
final rotateEffect = RotateEffect.to(
angle,
controller,
);
rotateEffect.removeOnFinish = true;
viewfinder.add(rotateEffect);
}
}