Created
December 12, 2018 06:30
-
-
Save nitishk72/6fb5ca995038b52c14b84dbc6987e45a 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/material.dart'; | |
// usage for this route | |
// Navigator.push(context, AppSlideRoute(builder: (context) => new SecondPage(),),); | |
class AppSlideRoute<T> extends MaterialPageRoute<T> { | |
AppSlideRoute({WidgetBuilder builder, RouteSettings settings}) | |
: super(builder: builder, settings: settings); | |
@override | |
Widget buildTransitions(BuildContext context, Animation<double> animation, | |
Animation<double> secondaryAnimation, Widget child) { | |
if (settings.isInitialRoute) return child; | |
return new FadeTransition(opacity: animation, child: child); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment