Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (25 sloc) 716 Bytes
import 'package:flutter/material.dart';
class SlideRoute extends PageRoute {
final Widget child;
SlideRoute(this.child);
@override
Color get barrierColor => null;
@override
String get barrierLabel => null;
@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return FadeTransition(
opacity: animation,
child: SlideTransition(
position: Tween(begin: const Offset(0.4, 0.0), end: Offset.zero)
.animate(animation),
child: child,
),
);
}
@override
bool get maintainState => true;
@override
Duration get transitionDuration => const Duration(milliseconds: 200);
}