createAnimation method

  1. @override
Animation<double> createAnimation()
override

Called to create the animation that exposes the current progress of the transition controlled by the animation controller created by createAnimationController().

Implementation

@override
Animation<double> createAnimation() {
  assert(_animation == null);
  _animation = CurvedAnimation(
    parent: super.createAnimation(),

    // These curves were initially measured from native iOS horizontal page
    // route animations and seemed to be a good match here as well.
    curve: Curves.linearToEaseOut,
    reverseCurve: Curves.linearToEaseOut.flipped,
  );
  _offsetTween = Tween<Offset>(
    begin: const Offset(0.0, 1.0),
    end: Offset.zero,
  );
  return _animation!;
}