createRoute<T> method

Route<T> createRoute<T>(
  1. Widget screen,
  2. BuildContext context,
  3. int durationMs
)

Implementation

Route<T> createRoute<T>(Widget screen, BuildContext context, int durationMs) {
  switch (this) {
    case NavAni.Left:
      return SlideFromLeftRoute<T>(screen, durationMs: durationMs);
    case NavAni.Right:
      return Nav.getPushRightRoute<T>(screen,
          context: context, prohibitSwipeBack: false, durationMs: durationMs);
    case NavAni.Top:
      return SlideFromTopRoute<T>(screen, durationMs: durationMs);
    case NavAni.Bottom:
      return SlideFromBottomRoute<T>(screen, durationMs: durationMs);
    case NavAni.Fade:
      return FadeRoute<T>(screen, durationMs: durationMs);
    case NavAni.Blink:
      return BlinkRoute<T>(screen);
    case NavAni.Ripple:
      final height = MediaQuery.of(context).size.height;
      final width = MediaQuery.of(context).size.width;

      return RoundRevealRoute<T>(screen,
          maxRadius: height + width / 2,
          centerAlignment: Alignment.bottomRight,
          centerOffset: const Offset(10, 10),
          minRadius: 10,
          durationMs: durationMs);
  }
}