import 'package:flutter/material.dart'; //Slide Transition class SlideLeftRoute extends PageRouteBuilder { final Widget page; SlideLeftRoute({this.page}) : super( pageBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, ) => page, transitionsBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, Widget child, ) => SlideTransition( position: Tween( begin: const Offset(1, 0), end: Offset.zero, ).animate(animation), child: child, ), ); } class SlideLeftHideRoute extends PageRouteBuilder { final Widget page; final Widget transitionPage; SlideLeftHideRoute({this.page, this.transitionPage}) : super( pageBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, ) => page, transitionDuration: Duration(milliseconds: 500), transitionsBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, Widget child, ) { return SlideTransition( position: Tween( begin: const Offset(1, 0), end: Offset.zero, ).animate(animation), child: child); }, ); } class SlideUptRoute extends PageRouteBuilder { final Widget page; SlideUptRoute({this.page}) : super( pageBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, ) => page, transitionsBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, Widget child, ) => SlideTransition( position: Tween( begin: const Offset(0, 1), end: Offset.zero, ).animate(animation), child: child, ), ); } //Scale Pageroute class ScaleRoute extends PageRouteBuilder { final Widget page; ScaleRoute({this.page}) : super( pageBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, ) => page, transitionsBuilder: ( BuildContext context, Animation animation, Animation secondaryAnimation, Widget child, ) => ScaleTransition( scale: Tween( begin: 0.0, end: 1.0, ).animate( CurvedAnimation( parent: animation, curve: Curves.fastOutSlowIn, ), ), child: child, ), ); }