Browse Source

add TransitionType.inFromTop

lukepighetti 5 years ago
parent
commit
f21de409f8
2 changed files with 8 additions and 0 deletions
  1. 1 0
      lib/src/common.dart
  2. 7 0
      lib/src/fluro_router.dart

+ 1 - 0
lib/src/common.dart

@@ -44,6 +44,7 @@ enum TransitionType {
   inFromLeft,
   inFromRight,
   inFromBottom,
+  inFromTop,
   fadeIn,
   custom, // if using custom then you must also provide a transition
   material,

+ 7 - 0
lib/src/fluro_router.dart

@@ -200,6 +200,7 @@ class FluroRouter {
         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) {
@@ -208,6 +209,12 @@ class FluroRouter {
         } else if (transitionType == TransitionType.inFromRight) {
           startOffset = topRight;
           endOffset = topLeft;
+        } else if (transitionType == TransitionType.inFromBottom) {
+          startOffset = bottomLeft;
+          endOffset = topLeft;
+        } else if (transitionType == TransitionType.inFromTop) {
+          startOffset = Offset(0.0, -1.0);
+          endOffset = topLeft;
         }
 
         return SlideTransition(