PageTransitionEffects constructor

PageTransitionEffects({
  1. required BuildContext context,
  2. required Widget page,
  3. AnimationType animation = AnimationType.normal,
  4. Duration duration = const Duration(milliseconds: 300),
  5. bool replacement = false,
})

Implementation

PageTransitionEffects({
  required this.context,
  required this.page,
  this.animation = AnimationType.normal,
  this.duration = const Duration(milliseconds: 300),
  this.replacement = false,
}) {
  switch (animation) {
    case AnimationType.normal:
      _normalTransition();
      break;
    case AnimationType.fadeIn:
      _fadeInTransition();
      break;
    case AnimationType.slideUp:
      _slideUpTransition();
      break;
    case AnimationType.slideDown:
      _slideDownTransition();
      break;
    case AnimationType.slideLeft:
      _slideLeftTransition();
      break;

    case AnimationType.slideRight:
      _slideRightTransition();
      break;

    default:
      Navigator.push(context, MaterialPageRoute(builder: (context) => page));
  }
}