Created
November 15, 2019 20:07
-
-
Save TechieBlossom/12dd33b73bd7c93c4338af56126f1913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/widgets.dart'; | |
class FadePageRoute extends PageRouteBuilder { | |
final Widget widget; | |
FadePageRoute({this.widget}) | |
: super( | |
pageBuilder: ( | |
BuildContext context, | |
Animation<double> animation, | |
Animation<double> secondaryAnimation, | |
) { | |
return widget; | |
}, | |
transitionsBuilder: (( | |
BuildContext context, | |
Animation<double> animation, | |
Animation<double> secondaryAnimation, | |
Widget child, | |
) { | |
return FadeTransition( | |
opacity: Tween(begin: 0.0, end: 1.0).animate(animation), | |
child: child, | |
); | |
}), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment