diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae4a78..36a2687 100644 --- a/CHANGELOG.md +++ b/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. diff --git a/LICENSE b/LICENSE index 1dab5f2..935041e 100644 --- a/LICENSE +++ b/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 diff --git a/README.md b/README.md index 1ed1785..6c5a867 100644 --- a/README.md +++ b/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: diff --git a/example/lib/components/app/app_component.dart b/example/lib/components/app/app_component.dart index 6be8cd6..734386e 100644 --- a/example/lib/components/app/app_component.dart +++ b/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'; diff --git a/example/lib/components/demo/demo_message_component.dart b/example/lib/components/demo/demo_message_component.dart index 6a454b3..85e5b1a 100644 --- a/example/lib/components/demo/demo_message_component.dart +++ b/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'; diff --git a/example/lib/components/demo/demo_result_component.dart b/example/lib/components/demo/demo_result_component.dart index f96c7fd..5255bff 100644 --- a/example/lib/components/demo/demo_result_component.dart +++ b/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'; diff --git a/example/lib/components/demo/demo_simple_component.dart b/example/lib/components/demo/demo_simple_component.dart index bb14301..651d9e2 100644 --- a/example/lib/components/demo/demo_simple_component.dart +++ b/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'; diff --git a/example/lib/components/home/home_component.dart b/example/lib/components/home/home_component.dart index c98d63e..e1a371f 100644 --- a/example/lib/components/home/home_component.dart +++ b/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'; diff --git a/example/lib/config/application.dart b/example/lib/config/application.dart index e7b744a..10dd398 100644 --- a/example/lib/config/application.dart +++ b/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'; diff --git a/example/lib/config/route_handlers.dart b/example/lib/config/route_handlers.dart index a456a4d..3780c09 100644 --- a/example/lib/config/route_handlers.dart +++ b/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'; diff --git a/example/lib/config/routes.dart b/example/lib/config/routes.dart index 536f362..62a5a2f 100644 --- a/example/lib/config/routes.dart +++ b/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'; diff --git a/example/lib/helpers/color_helpers.dart b/example/lib/helpers/color_helpers.dart index a0341d3..71ffd61 100644 --- a/example/lib/helpers/color_helpers.dart +++ b/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'; diff --git a/example/lib/main.dart b/example/lib/main.dart index a3c42ed..c4957da 100644 --- a/example/lib/main.dart +++ b/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'; diff --git a/lib/fluro.dart b/lib/fluro.dart index b9f1df2..d015940 100644 --- a/lib/fluro.dart +++ b/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; diff --git a/lib/src/common.dart b/lib/src/common.dart index 4c62fce..28256bf 100644 --- a/lib/src/common.dart +++ b/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. */ diff --git a/lib/src/router.dart b/lib/src/router.dart index cebd0f6..c04201f 100644 --- a/lib/src/router.dart +++ b/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> parameters) { bool isNativeTransition = (transition == TransitionType.native || transition == TransitionType.nativeModal); - if (transition == TransitionType.cupertino || transition == TransitionType.cupertinoFullScreenDialog) { - return new CupertinoPageRoute( - settings: routeSettings, - fullscreenDialog: transition == TransitionType.cupertinoFullScreenDialog, - builder: (BuildContext context) { - return handler.handlerFunc(context, parameters); - }); - } else if (isNativeTransition) { - return new MaterialPageRoute( - settings: routeSettings, - fullscreenDialog: transition == TransitionType.nativeModal, - builder: (BuildContext context) { - return handler.handlerFunc(context, parameters); - }); + if (isNativeTransition) { + if (Platform.isIOS) { + return new CupertinoPageRoute( + 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( + settings: routeSettings, + fullscreenDialog: + transition == TransitionType.cupertinoFullScreenDialog, + builder: (BuildContext context) { + return handler.handlerFunc(context, parameters); + }); + } else { + return new MaterialPageRoute( + settings: routeSettings, + fullscreenDialog: transition == TransitionType.nativeModal, + builder: (BuildContext context) { + return handler.handlerFunc(context, parameters); + }); + } } else { var routeTransitionsBuilder; if (transition == TransitionType.custom) { diff --git a/lib/src/tree.dart b/lib/src/tree.dart index 79f3779..7082009 100644 --- a/lib/src/tree.dart +++ b/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. */ diff --git a/pubspec.yaml b/pubspec.yaml index 4a1f697..509bfde 100644 --- a/pubspec.yaml +++ b/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 +version: 1.5.0 +author: Yakka, LLC 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 diff --git a/test/parser_test.dart b/test/parser_test.dart index 6209b23..5388b31 100644 --- a/test/parser_test.dart +++ b/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. */