RouteTransition constructor
RouteTransition({
- required BuildContext context,
- required Widget child,
- Curve curve = Curves.easeInOut,
- RouteTransitionAnimation animation = RouteTransitionAnimation.normal,
- Duration duration = const Duration(milliseconds: 300),
- double from = 0.0,
- RouteTransitionType type = RouteTransitionType.normal,
Implementation
RouteTransition({
required this.context,
required this.child,
this.curve = Curves.easeInOut,
this.animation = RouteTransitionAnimation.normal,
this.duration = const Duration(milliseconds: 300),
this.from = 0.0,
this.type = RouteTransitionType.normal,
}) {
switch (animation) {
case RouteTransitionAnimation.normal:
_route = _normalTransition();
break;
default:
_route = _transition();
}
switch (type) {
case RouteTransitionType.normal:
_pushPage();
break;
case RouteTransitionType.replaceLast:
_pushReplacementPage();
break;
case RouteTransitionType.replaceAll:
_pushReplaceAllPage();
break;
default:
_pushPage();
}
}