topToBottom static method

SlideTransition topToBottom(
  1. dynamic context,
  2. dynamic animation,
  3. dynamic secondaryAnimation,
  4. dynamic child,
)

Animation method for top to bottom

Implementation

static SlideTransition topToBottom(context, animation, secondaryAnimation, child) {
  const begin = Offset(0.0, -1.0);
  const end = Offset.zero;
  const curve = Curves.easeInOutSine;
  final tween = Tween(begin: begin, end: end);
  final curvedAnimation = CurvedAnimation(
    parent: animation,
    curve: curve,
  );
  return SlideTransition(
    position: tween.animate(curvedAnimation),
    child: child,
  );
}