RouteTransition constructor

RouteTransition({
  1. required BuildContext context,
  2. required Widget child,
  3. Curve curve = Curves.easeInOut,
  4. RouteTransitionAnimation animation = RouteTransitionAnimation.normal,
  5. Duration duration = const Duration(milliseconds: 300),
  6. double from = 0.0,
  7. 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();
  }
}