PageTransitionEffects constructor
PageTransitionEffects({
- required BuildContext context,
- required Widget page,
- AnimationType animation = AnimationType.normal,
- Duration duration = const Duration(milliseconds: 300),
- 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));
}
}