moveIn method

void moveIn({
  1. double? x,
  2. double? y,
  3. int time = 1600,
  4. dynamic onComplete(
    1. dynamic obj
    )?,
  5. dynamic ease,
})

/////////////////////////////////////////////////////////

Admission/appearance animation - Move in and out

/////////////////////////////////////////////////////////

Implementation

void moveIn(
    {double? x,
    double? y,
    int time = 1600,
    Function(dynamic obj)? onComplete,
    dynamic ease}) {
  this.alpha = 0;
  var oldPos = this.position.clone();
  this.position.x = x ?? this.position.x;
  this.position.y = y ?? this.position.y;

  ZKTween(this)
      .to({"alpha": 1, "x": oldPos.x, "y": oldPos.y}, time)
      .easing(ease ?? Ease.quart.easeOut)
      .onComplete(onComplete!)
      .start();
}