fromTop static method

Widget fromTop(
  1. Animation<double> animation,
  2. Animation<double> secondaryAnimation,
  3. Widget child
)

Slide animation, from top to bottom (SlideTransition)

Implementation

static Widget fromTop(
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  return FadeTransition(
    opacity: animation,
    child: SlideTransition(
      position: Tween<Offset>(
        begin: const Offset(0, -0.2),
        end: Offset.zero,
      ).animate(
        CurvedAnimation(
          parent: animation,
          curve: Curves.ease,
        ),
      ),
      child: child,
    ),
  );
}