Created
July 30, 2018 20:02
-
-
Save diegoveloper/fb04631fd685e7982848ffe25035d639 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'; | |
class HeroDialogRoute<T> extends PageRoute<T> { | |
HeroDialogRoute({this.builder}) : super(); | |
final WidgetBuilder builder; | |
@override | |
bool get opaque => false; | |
@override | |
bool get barrierDismissible => true; | |
@override | |
Duration get transitionDuration => const Duration(milliseconds: 500); | |
@override | |
bool get maintainState => true; | |
@override | |
Color get barrierColor => Colors.black54; | |
@override | |
Widget buildTransitions(BuildContext context, Animation<double> animation, | |
Animation<double> secondaryAnimation, Widget child) { | |
return new FadeTransition( | |
opacity: new CurvedAnimation(parent: animation, curve: Curves.easeOut), | |
child: child); | |
} | |
@override | |
Widget buildPage(BuildContext context, Animation<double> animation, | |
Animation<double> secondaryAnimation) { | |
return builder(context); | |
} | |
@override | |
String get barrierLabel => null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment