Bläddra i källkod

added cupertino native transition check. bump docs. prepare for release.

Luke Freeman 6 år sedan
förälder
incheckning
3d5a90de0d

+ 5 - 0
CHANGELOG.md

@@ -1,3 +1,8 @@
+# 1.5.0
+- Native transitions will now use the Cupertino page route on iOS and Material page route on android. This will enable swipe gestures on iOS.
+- Added cupertino specific transition types. 
+- **You should not be using Cupertino types on non-iOS platforms. It's up to you, but it's bad design**.
+
 # 1.4.0
 - Added the ability to define a transition at the point of route definition. Route transitions are optional and any transition defined a "push" will override the route definition.
 

+ 1 - 1
LICENSE

@@ -3,7 +3,7 @@ Fluro
 Created by Yakka
 https://theyakka.com
 
-Copyright (c) 2018 Yakka LLC.
+Copyright (c) 2019 Yakka LLC.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

+ 2 - 2
README.md

@@ -3,7 +3,7 @@
 
 The brightest, hippest, coolest router for Flutter.
 
-[![Version](https://img.shields.io/badge/version-1.4.0-blue.svg)](https://pub.dartlang.org/packages/fluro)
+[![Version](https://img.shields.io/badge/version-1.5.0-blue.svg)](https://pub.dartlang.org/packages/fluro)
 [![Build Status](https://travis-ci.org/theyakka/fluro.svg?branch=master)](https://travis-ci.org/theyakka/fluro)
 [![Coverage](https://codecov.io/gh/theyakka/fluro/branch/master/graph/badge.svg)](https://codecov.io/gh/theyakka/fluro)
 
@@ -25,7 +25,7 @@ See CHANGELOG for all breaking (and non-breaking) changes.
 You should ensure that you add the router as a dependency in your flutter project.
 ```yaml
 dependencies:
- fluro: "^1.4.0"
+ fluro: "^1.5.0"
 ```
 
 You can also reference the git repo directly if you want:

+ 1 - 1
example/lib/components/app/app_component.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import '../../config/application.dart';

+ 1 - 1
example/lib/components/demo/demo_message_component.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'package:flutter/material.dart';

+ 1 - 1
example/lib/components/demo/demo_result_component.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'package:flutter/material.dart';

+ 1 - 1
example/lib/components/demo/demo_simple_component.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import '../../helpers/color_helpers.dart';

+ 1 - 1
example/lib/components/home/home_component.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'dart:async';

+ 1 - 1
example/lib/config/application.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'package:fluro/fluro.dart';

+ 1 - 1
example/lib/config/route_handlers.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import '../helpers/color_helpers.dart';

+ 1 - 1
example/lib/config/routes.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'package:fluro/fluro.dart';

+ 1 - 1
example/lib/helpers/color_helpers.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'package:flutter/material.dart';

+ 1 - 1
example/lib/main.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 import 'components/app/app_component.dart';

+ 1 - 1
lib/fluro.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 library fluro;

+ 1 - 1
lib/src/common.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 

+ 27 - 15
lib/src/router.dart

@@ -3,11 +3,12 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 
 import 'dart:async';
+import 'dart:io';
 
 import 'package:fluro/fluro.dart';
 import 'package:fluro/src/common.dart';
@@ -124,20 +125,31 @@ class Router {
         (RouteSettings routeSettings, Map<String, List<String>> parameters) {
       bool isNativeTransition = (transition == TransitionType.native ||
           transition == TransitionType.nativeModal);
-      if (transition == TransitionType.cupertino || transition == TransitionType.cupertinoFullScreenDialog) {
-        return new CupertinoPageRoute<dynamic>(
-            settings: routeSettings,
-            fullscreenDialog: transition == TransitionType.cupertinoFullScreenDialog,
-            builder: (BuildContext context) {
-              return handler.handlerFunc(context, parameters);
-            });
-      } else if (isNativeTransition) {
-        return new MaterialPageRoute<dynamic>(
-            settings: routeSettings,
-            fullscreenDialog: transition == TransitionType.nativeModal,
-            builder: (BuildContext context) {
-              return handler.handlerFunc(context, parameters);
-            });
+      if (isNativeTransition) {
+        if (Platform.isIOS) {
+          return new CupertinoPageRoute<dynamic>(
+              settings: routeSettings,
+              fullscreenDialog: transition == TransitionType.nativeModal,
+              builder: (BuildContext context) {
+                return handler.handlerFunc(context, parameters);
+              });
+        } else if (transition == TransitionType.cupertino ||
+            transition == TransitionType.cupertinoFullScreenDialog) {
+          return new CupertinoPageRoute<dynamic>(
+              settings: routeSettings,
+              fullscreenDialog:
+                  transition == TransitionType.cupertinoFullScreenDialog,
+              builder: (BuildContext context) {
+                return handler.handlerFunc(context, parameters);
+              });
+        } else {
+          return new MaterialPageRoute<dynamic>(
+              settings: routeSettings,
+              fullscreenDialog: transition == TransitionType.nativeModal,
+              builder: (BuildContext context) {
+                return handler.handlerFunc(context, parameters);
+              });
+        }
       } else {
         var routeTransitionsBuilder;
         if (transition == TransitionType.custom) {

+ 1 - 1
lib/src/tree.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */
 

+ 5 - 4
pubspec.yaml

@@ -2,12 +2,13 @@ name: fluro
 description: >
   Fluro is a Flutter routing library that adds flexible routing options like wildcards, named
   parameters and clear route definitions.
-version: 1.4.0
-author: Yakka, LLC <flutter@theyakka.com>
+version: 1.5.0
+author: Yakka, LLC <apps@theyakka.com>
 homepage: https://github.com/theyakka/fluro
 
 environment:
-  sdk: ">=2.0.0-dev.58.0 <3.0.0"
+  sdk: ">=2.1.0 <3.0.0"
+  flutter: ">=1.2.0"
 
 dependencies:
   flutter:
@@ -16,7 +17,7 @@ dependencies:
 dev_dependencies:
   flutter_test:
     sdk: flutter
-  test: "^1.3.3"
+  test: ^1.6.0
 
 flutter:
   uses-material-design: false

+ 1 - 1
test/parser_test.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * https://theyakka.com
  * 
- * Copyright (c) 2018 Yakka, LLC. All rights reserved.
+ * Copyright (c) 2019 Yakka, LLC. All rights reserved.
  * See LICENSE for distribution and usage details.
  */