buildWidget method

  1. @override
Widget buildWidget(
  1. Widget child,
  2. AnimationController controller,
  3. AlignmentGeometry alignment
)
override

Implementation

@override
Widget buildWidget(
  Widget child,
  AnimationController controller,
  AlignmentGeometry alignment,
) {
  Offset begin = alignment == AlignmentDirectional.topCenter
      ? const Offset(0, -1)
      : alignment == AlignmentDirectional.bottomCenter
          ? const Offset(0, 1)
          : const Offset(0, 0);
  Animation<Offset> animation = Tween(
    begin: begin,
    end: const Offset(0, 0),
  ).animate(controller);
  return Opacity(
    opacity: controller.value,
    child: SlideTransition(
      position: animation,
      child: child,
    ),
  );
}