pageRoute method

  1. @override
PageRouteBuilder pageRoute(
  1. String name,
  2. Map<String, dynamic>? parameters,
  3. Widget page
)
override

Implementation

@override
PageRouteBuilder pageRoute(
    String name, Map<String, dynamic>? parameters, Widget page) {
  var milliseconds =
      _monaStyle.monaStyleAttributesModel.routeAnimationDuration ?? 1000;
  switch (_monaStyle.monaStyleAttributesModel.routeBuilder) {
    case PageTransitionAnimation.slideRightToLeft:
      return RightToLeftRoute(
          name: name,
          parameters: parameters,
          page: page,
          milliseconds: milliseconds);
    case PageTransitionAnimation.slideBottomToTop:
      return BottomToTopRoute(
          name: name,
          parameters: parameters,
          page: page,
          milliseconds: milliseconds);
    case PageTransitionAnimation.scaleRoute:
      return ScaleRoute(
          name: name,
          parameters: parameters,
          page: page,
          milliseconds: milliseconds);
    case PageTransitionAnimation.rotationRoute:
      return RotationRoute(
          name: name,
          parameters: parameters,
          page: page,
          milliseconds: milliseconds);
    case PageTransitionAnimation.fadeRoute:
/*
      return FadeRoute(
          name: name,
          parameters: parameters,
          page: page,
          milliseconds: milliseconds);
*/
    case PageTransitionAnimation.unknown:
      break;
    case null:
      break;
  }
  // default
  return FadeRoute(
      name: name,
      parameters: parameters,
      page: page,
      milliseconds: milliseconds);
}