浏览代码

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

Luke Freeman 6 年之前
父节点
当前提交
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
 # 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.
 - 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
 Created by Yakka
 https://theyakka.com
 https://theyakka.com
 
 
-Copyright (c) 2018 Yakka LLC.
+Copyright (c) 2019 Yakka LLC.
 All rights reserved.
 All rights reserved.
 
 
 Redistribution and use in source and binary forms, with or without
 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.
 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)
 [![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)
 [![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.
 You should ensure that you add the router as a dependency in your flutter project.
 ```yaml
 ```yaml
 dependencies:
 dependencies:
- fluro: "^1.4.0"
+ fluro: "^1.5.0"
 ```
 ```
 
 
 You can also reference the git repo directly if you want:
 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
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import '../../config/application.dart';
 import '../../config/application.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import '../../helpers/color_helpers.dart';
 import '../../helpers/color_helpers.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'dart:async';
 import 'dart:async';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'package:fluro/fluro.dart';
 import 'package:fluro/fluro.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import '../helpers/color_helpers.dart';
 import '../helpers/color_helpers.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'package:fluro/fluro.dart';
 import 'package:fluro/fluro.dart';

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

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';

+ 1 - 1
example/lib/main.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 import 'components/app/app_component.dart';
 import 'components/app/app_component.dart';

+ 1 - 1
lib/fluro.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 library fluro;
 library fluro;

+ 1 - 1
lib/src/common.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 
 

+ 27 - 15
lib/src/router.dart

@@ -3,11 +3,12 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 
 
 import 'dart:async';
 import 'dart:async';
+import 'dart:io';
 
 
 import 'package:fluro/fluro.dart';
 import 'package:fluro/fluro.dart';
 import 'package:fluro/src/common.dart';
 import 'package:fluro/src/common.dart';
@@ -124,20 +125,31 @@ class Router {
         (RouteSettings routeSettings, Map<String, List<String>> parameters) {
         (RouteSettings routeSettings, Map<String, List<String>> parameters) {
       bool isNativeTransition = (transition == TransitionType.native ||
       bool isNativeTransition = (transition == TransitionType.native ||
           transition == TransitionType.nativeModal);
           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 {
       } else {
         var routeTransitionsBuilder;
         var routeTransitionsBuilder;
         if (transition == TransitionType.custom) {
         if (transition == TransitionType.custom) {

+ 1 - 1
lib/src/tree.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */
 
 

+ 5 - 4
pubspec.yaml

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

+ 1 - 1
test/parser_test.dart

@@ -3,7 +3,7 @@
  * Created by Yakka
  * Created by Yakka
  * https://theyakka.com
  * 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.
  * See LICENSE for distribution and usage details.
  */
  */