RouteTransitions constructor

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

Constructor of main class context contex of app child Target Widget duration animation effect duration animation animation type available replacement determines the push for the route

Implementation

RouteTransitions({
  required this.context,
  required this.child,
  this.duration = const Duration(milliseconds: 500),
  this.animation = AnimationType.normal,
  this.replacement = false,
}) {
  /// Type of animation to run
  switch (animation) {
    case AnimationType.normal:
      _normalTransition();
      break;
    case AnimationType.fadeIn:
      _fadeInTransition();
      break;
  }
}