浏览代码

updated to fix flutter changes

Albert Lardizabal 8 年之前
父节点
当前提交
8cc6d70b23
共有 2 个文件被更改,包括 11 次插入8 次删除
  1. 1 1
      example/lib/components/app/app_component.dart
  2. 10 7
      lib/src/router.dart

+ 1 - 1
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 {
 

+ 10 - 7
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<Offset>(
             begin: startOffset,
             end: endOffset,
           ).animate(animation),