From 8cc6d70b238948f01a8655fd0f777c2009fd22bf Mon Sep 17 00:00:00 2001 From: Albert Lardizabal Date: Fri, 6 Oct 2017 16:35:51 -0400 Subject: [PATCH] updated to fix flutter changes --- example/lib/components/app/app_component.dart | 2 +- lib/src/router.dart | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/example/lib/components/app/app_component.dart b/example/lib/components/app/app_component.dart index f137cff..3fda17d 100644 --- a/example/lib/components/app/app_component.dart +++ b/example/lib/components/app/app_component.dart @@ -9,8 +9,8 @@ import '../../config/application.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:fluro/fluro.dart'; +import '../../config/routes.dart'; import '../home/home_component.dart'; -import 'package:router_example/config/routes.dart'; class AppComponent extends StatefulWidget { diff --git a/lib/src/router.dart b/lib/src/router.dart index 920a79a..93f9e20 100644 --- a/lib/src/router.dart +++ b/lib/src/router.dart @@ -122,18 +122,21 @@ class Router { if (transitionType == TransitionType.fadeIn) { return new FadeTransition(opacity: animation, child: child); } else { - FractionalOffset startOffset = FractionalOffset.bottomLeft; - FractionalOffset endOffset = FractionalOffset.topLeft; + const Offset topLeft = const Offset(0.0, 0.0); + const Offset topRight = const Offset(1.0, 0.0); + const Offset bottomLeft = const Offset(0.0, 1.0); + Offset startOffset = bottomLeft; + Offset endOffset = topLeft; if (transitionType == TransitionType.inFromLeft) { - startOffset = new FractionalOffset(-1.0, 0.0); - endOffset = FractionalOffset.topLeft; + startOffset = const Offset(-1.0, 0.0); + endOffset = topLeft; } else if (transitionType == TransitionType.inFromRight) { - startOffset = FractionalOffset.topRight; - endOffset = FractionalOffset.topLeft; + startOffset = topRight; + endOffset = topLeft; } return new SlideTransition( - position: new FractionalOffsetTween( + position: new Tween( begin: startOffset, end: endOffset, ).animate(animation),